[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kst/1.5/kst/src/libkstapp
From:       Duncan Hanson <duncan.hanson () gmail ! com>
Date:       2007-04-30 19:20:20
Message-ID: 1177960820.776484.3518.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 659768 by dhanson:

CCBUG:143804 most straightforward solution-- non-centered resizing of ellipses when edges are dragged.

 M  +5 -12     kstviewellipse.cpp  


--- branches/work/kst/1.5/kst/src/libkstapp/kstviewellipse.cpp #659767:659768
@@ -95,22 +95,15 @@
     }
   }
 
-  const QRect g(geometry());
-  int bw(_borderWidth * p.lineWidthAdjustmentFactor());
-  if (bw > g.width()/2) {
-    bw = g.width()/2;
-  }
-  if (bw > g.height()/2) {
-    bw = g.height()/2;
-  }
+  const int bw(_borderWidth * p.lineWidthAdjustmentFactor());
   QPen pen(bw > 0 ? _borderColor : _foregroundColor, bw);
   p.setPen(pen);
   if (_transparentFill) {
-    p.setBrush(Qt::NoBrush);
+    p.setBrush(Qt::NoBrush);  
   } else {
     p.setBrush(_foregroundColor);
   }
-
+  const QRect g(geometry());
   p.drawEllipse(g.x() + bw/2, g.y() + bw/2, g.width() - bw, g.height() - bw);
   p.restore();
 }
@@ -185,8 +178,8 @@
 
 signed int KstViewEllipse::directionFor(const QPoint& pos) {
   signed int direction = KstViewObject::directionFor(pos);
-  if (direction != 0) {
-    // not moving, so in any resize direction, we want it centred
+  if (!(((direction & (UP|DOWN)) == 0) || ((direction & (LEFT|RIGHT)) == 0))) {
+    // not an edge.
     direction |= CENTEREDRESIZE;  
   }  
   return direction;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic