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

[XaraXtreme-commits] Commit Complete



Commit by  : phil
Repository : xara
Revision   : 1245
Date       : Mon Jun  5 10:20:19 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/camview.cpp
   M /Trunk/XaraLX/wxOil/scrvw.cpp

Re-instated some scroll offset checks to avoid ERROR3 reports.


Diff:
Index: Trunk/XaraLX/wxOil/scrvw.cpp
===================================================================
--- Trunk/XaraLX/wxOil/scrvw.cpp	(revision 1244)
+++ Trunk/XaraLX/wxOil/scrvw.cpp	(revision 1245)
@@ -3260,6 +3260,12 @@
 		offset.x += dx * PixelWidth;
 		offset.y -= dy * PixelHeight;
 			
+		WorkRect wrScrollRect = GetMaxScrollRect();
+		if (offset.x < wrScrollRect.lo.x)	offset.x = wrScrollRect.lo.x;
+		if (offset.y < wrScrollRect.lo.y)	offset.y = wrScrollRect.lo.y;
+		if (offset.x > wrScrollRect.hi.x)	offset.x = wrScrollRect.hi.x;
+		if (offset.y > wrScrollRect.hi.y)	offset.y = wrScrollRect.hi.y;
+
 		// By calling DocView to do the scroll we give it a chance to remove
 		// any blobbies it might have put on the screen.  Note that the scrollers
 		// will prevent any overscroll.
Index: Trunk/XaraLX/wxOil/camview.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camview.cpp	(revision 1244)
+++ Trunk/XaraLX/wxOil/camview.cpp	(revision 1245)
@@ -3986,6 +3986,12 @@
 	pDocView->GetPixelSize(&PixelWidth, &PixelHeight);
 	offset.x += dx * PixelWidth;
 	offset.y -= dy * PixelHeight;
+
+	WorkRect wrScrollRect = GetMaxScrollRect();
+	if (offset.x < wrScrollRect.lo.x)	offset.x = wrScrollRect.lo.x;
+	if (offset.y < wrScrollRect.lo.y)	offset.y = wrScrollRect.lo.y;
+	if (offset.x > wrScrollRect.hi.x)	offset.x = wrScrollRect.hi.x;
+	if (offset.y > wrScrollRect.hi.y)	offset.y = wrScrollRect.hi.y;
 //	TRACEUSER("Gerry", _T("NewOffset = (%d, %d)
"), (INT32)offset.x, (INT32)offset.y);
 
 	// By calling DocView to do the scroll we give it a chance to remove


Xara