[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-dev] Fix for BZ 1269

Find attached below a fix for BZ 1269. Ironically, this is what the 
code looked like initially, but in a last minute change I decided to 
use UserRect::Translate to improve readability. I did not realize that 
that routine would check whether the coordinates make sense (which 
they don't because only one half of each coord is actually used).

Index: Kernel/rulers.cpp
--- Kernel/rulers.cpp	(Revision 1450)
+++ Kernel/rulers.cpp	(Arbeitskopie)
@@ -190,7 +190,12 @@
 	UserCoord Offsets(0, 0);
 	if (Tool::GetCurrent())
 		Tool::GetCurrent()->GetRulerOrigin(pSpread, &Offsets);
-	UpdateRect.Translate(-Offsets.x, -Offsets.y);
+	// We translate the rectangle by the tool-supplied offsets. We do not call UserRect::Translate
+	// since our rectangle is not necessarily valid due to MakeCoord used in the limit checks above
+	UpdateRect.lo.x -= Offsets.x;
+	UpdateRect.lo.y -= Offsets.y;
+	UpdateRect.hi.x -= Offsets.x;
+	UpdateRect.hi.y -= Offsets.y;
 	// allow the current tool to render background blobs
 	if (Tool::GetCurrent())