diff options
author | Andreas Kling <kling@serenityos.org> | 2022-08-25 20:27:43 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-08-26 01:04:52 +0200 |
commit | e6d860f2fe49ad8f39300087d1d9da3e052f3faf (patch) | |
tree | 160d843538f1227fbbca28ecf811de7bdec2a0e4 | |
parent | d32f7112dc8e3aef664d8632b08aa6f47180f0d1 (diff) | |
download | serenity-e6d860f2fe49ad8f39300087d1d9da3e052f3faf.zip |
PixelPaint: Round mouse event coordinates instead of truncating
This makes the rectangle select tool feel a lot better when zoomed in.
-rw-r--r-- | Userland/Applications/PixelPaint/ImageEditor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp index e3db66dc17..3723034673 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.cpp +++ b/Userland/Applications/PixelPaint/ImageEditor.cpp @@ -261,7 +261,7 @@ GUI::MouseEvent ImageEditor::event_with_pan_and_scale_applied(GUI::MouseEvent co auto image_position = frame_to_content_position(event.position()); return { static_cast<GUI::Event::Type>(event.type()), - Gfx::IntPoint(image_position.x(), image_position.y()), + image_position.to_rounded<int>(), event.buttons(), event.button(), event.modifiers(), @@ -278,7 +278,7 @@ GUI::MouseEvent ImageEditor::event_adjusted_for_layer(GUI::MouseEvent const& eve image_position.translate_by(-layer.location().x(), -layer.location().y()); return { static_cast<GUI::Event::Type>(event.type()), - Gfx::IntPoint(image_position.x(), image_position.y()), + image_position.to_rounded<int>(), event.buttons(), event.button(), event.modifiers(), |