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

List:       kde-commits
Subject:    branches/work/kst/portto4/kst/src/libkstapp
From:       Barth Netterfield <netterfield () astro ! utoronto ! ca>
Date:       2012-06-19 23:33:30
Message-ID: 20120619233330.35DF6AC783 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1302005 by netterfield:

Line and arrow dimensions were sometimes very off when opened in the
dialog.  This fixes it.


 M  +5 -4      linedimensionstab.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/linedimensionstab.cpp \
#1302004:1302005 @@ -42,10 +42,11 @@
     QRectF pr = _viewItem->parentRect();
     QPointF P1 = _viewItem->mapToParent(QPoint(_viewItem->rect().left(), \
                _viewItem->rect().center().y()));
     QPointF P2 = _viewItem->mapToParent(QPoint(_viewItem->rect().right(), \
                _viewItem->rect().center().y()));
-    _p1X->setValue(P1.x()/pr.width());
-    _p2X->setValue(P2.x()/pr.width());
-    _p1Y->setValue(P1.y()/pr.height());
-    _p2Y->setValue(P2.y()/pr.height());
+    //qDebug() << pr << P1 << P2;
+    _p1X->setValue((P1.x()-pr.left())/pr.width());
+    _p2X->setValue((P2.x()-pr.left())/pr.width());
+    _p1Y->setValue((P1.y()-pr.top())/pr.height());
+    _p2Y->setValue((P2.y()-pr.top())/pr.height());
   }
 }
 


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

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