mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-20 00:12:20 +00:00
PixelPaint: Round mouse event coordinates instead of truncating
This makes the rectangle select tool feel a lot better when zoomed in.
This commit is contained in:
parent
d32f7112dc
commit
e6d860f2fe
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue