Skip to content
Permalink
Browse files

Fix for Mac window title and controls corruption which was caused by …

…an integer overflow when calculating an empty panning rectangle.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6471 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski
telwertowski committed Jan 29, 2007
1 parent 2db1de4 commit f4ec37456250d509f9b113999787987f509d76ad
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/gui/qgsmapoverviewcanvas.cpp
@@ -136,6 +136,15 @@ void QgsMapOverviewCanvas::reflectChangedExtent()
if (y1 > y2)
std::swap(y1, y2);

#ifdef Q_WS_MAC
// setGeometry (Qt 4.2) is causing Mac window corruption (decorations
// are drawn at odd locations) if both coords are at limit. This may
// have something to do with Qt calculating dimensions as x2 - x1 + 1.
// (INT_MAX - INT_MIN + 1 is UINT_MAX + 1)
if (x1 == INT_MIN && x2 == INT_MAX) x1 += 1; // x2 -= 1 works too
if (y1 == INT_MIN && y2 == INT_MAX) y1 += 1;
#endif

QRect r(x1, y1, x2-x1+1, y2-y1+1);

#ifdef QGISDEBUG

0 comments on commit f4ec374

Please sign in to comment.
You can’t perform that action at this time.