From c09842abdf52a85ce25d3d93388532c6ec06d761 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 11 Aug 2010 00:22:30 -0300 Subject: [PATCH] Fix selection tools when the cel is in x<0 and/or y<0. --- src/tools/inks.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/inks.h b/src/tools/inks.h index 6ded1af6d..6d85b3ca3 100644 --- a/src/tools/inks.h +++ b/src/tools/inks.h @@ -240,10 +240,12 @@ public: void inkHline(int x1, int y, int x2, IToolLoop* loop) { if (m_modify_selection) { + Point offset = loop->getOffset(); + if (loop->getMouseButton() == 0) - loop->getMask()->add(x1, y, x2-x1+1, 1); + loop->getMask()->add(x1-offset.x, y-offset.y, x2-x1+1, 1); else if (loop->getMouseButton() == 1) - mask_subtract(loop->getMask(), x1, y, x2-x1+1, 1); + mask_subtract(loop->getMask(), x1-offset.x, y-offset.y, x2-x1+1, 1); } else image_hline(loop->getDstImage(), x1, y, x2, loop->getPrimaryColor());