[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Tue Feb 8 05:28:20 CET 2005


CVS commit by staikos: 

fix off-by-one in geometry calculations that caused objects to be 1 pixel too
large in each dimension


  M +3 -2      kstviewobject.cpp   1.116


--- kdeextragear-2/kst/kst/kstviewobject.cpp  #1.115:1.116
@@ -936,7 +936,8 @@ void KstViewObject::updateFromAspect() {
     _geom.setLeft(_parent->geometry().left() + int(_aspect.x * _parent->geometry().width()));
     _geom.setTop(_parent->geometry().top() + int(_aspect.y * _parent->geometry().height()));
-    _geom.setRight(_parent->geometry().left() + int((_aspect.x + _aspect.w) * _parent->geometry().width()));
-    _geom.setBottom(_parent->geometry().top() + int((_aspect.y + _aspect.h) * _parent->geometry().height()));
+    _geom.setRight(_parent->geometry().left() + int((_aspect.x + _aspect.w) * _parent->geometry().width()) - 1);
+    _geom.setBottom(_parent->geometry().top() + int((_aspect.y + _aspect.h) * _parent->geometry().height()) - 1);
   }
+  assert(_geom.left() >= 0 && _geom.top() >= 0);
 }
 




More information about the Kst mailing list