From a5c7c3bcc456d03ae89f27bed54e2649242ae85b Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Mon, 15 Jun 2020 06:07:42 -0700 Subject: [PATCH] When dragging tile selections upwards or to the left, fix offset math. This way, the drag start position always gets the top left tile of the selection, rather than "randomly" toggling between two different tiles. --- src/editor/overlay_widget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor/overlay_widget.cpp b/src/editor/overlay_widget.cpp index 5a488f6c14c..2f7713307bc 100644 --- a/src/editor/overlay_widget.cpp +++ b/src/editor/overlay_widget.cpp @@ -175,8 +175,8 @@ void EditorOverlayWidget::draw_rectangle() { Rectf dr = drag_rect(); - dr.set_p1(sp_to_tp(dr.p1())); - dr.set_p2(sp_to_tp(dr.p2())); + dr.set_p1(sp_to_tp(dr.p1()).floor()); + dr.set_p2(sp_to_tp(dr.p2()).floor()); bool sgn_x = m_drag_start.x < m_sector_pos.x; bool sgn_y = m_drag_start.y < m_sector_pos.y;