[Kst] branches/work/kst/portto4/kst

Barth Netterfield netterfield at astro.utoronto.ca
Thu Aug 6 06:19:13 CEST 2009


SVN commit 1007685 by netterfield:

More fixups for line/arrow resize/move behaviour.



 M  +5 -12     devel-docs/Kst2Specs/Bugs  
 M  +8 -0      devel-docs/Kst2Specs/Wishlist  
 M  +6 -4      src/libkstapp/lineitem.cpp  
 M  +1 -2      src/libkstapp/plotitem.cpp  
 M  +1 -1      src/libkstapp/viewitem.cpp  
 M  +0 -3      src/libkstapp/viewitemdialog.cpp  


--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Bugs #1007684:1007685
@@ -1,15 +1,3 @@
-Plot sizes are not properly recovered on re-load
-Create a plot in kst.  Cleanup Layout->automatic
- -the plot now ~fills the window.
-save it.
-load it
-  -the plot is now smaller than it was.
-It should be the same size as it started.
-** it is now much better than it used to be.  The shift is now only a few pixels **
-** low priority **
-
---------------------
-
 Update ineffciency:
 One plot gets re-drawn twice in an update in PlotItem::updatePlotPixmap. (?)
 
@@ -20,3 +8,8 @@
 --------------------
 
 Rotated axis number label spacing is wrong
+
+--------------------
+
+Artifacts when resizing large arrowheads.
+
--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Wishlist #1007684:1007685
@@ -66,3 +66,11 @@
 
 DECIDE: absolute or relative file names in kst files?
 
+------------
+
+Sensible filter in image dialog
+
+------------
+
+Fixup line/arrow dimensions tab:
+  x,y instead of length/angle
\ No newline at end of file
--- branches/work/kst/portto4/kst/src/libkstapp/lineitem.cpp #1007684:1007685
@@ -163,7 +163,10 @@
   }
 
   if (parentView()->mouseMode() == View::Default) {
-    if (gripMode() == ViewItem::Resize) {
+    if (gripMode() == ViewItem::Move || activeGrip() == NoGrip) {
+      parentView()->setMouseMode(View::Move);
+      parentView()->undoStack()->beginMacro(tr("Move"));
+    } else if (gripMode() == ViewItem::Resize) {
       parentView()->setMouseMode(View::Resize);
       parentView()->undoStack()->beginMacro(tr("Resize"));
     }
@@ -239,10 +242,9 @@
   QTransform transform;
   transform.rotate(atan2(newDy, newDx)*180.0/M_PI);
 
-  QRectF itemRect = rect();
-  itemRect.setWidth(newWidth); // new length...
   // my brain hurts less for rotations when we center the object at 0,0
-  itemRect.setTopLeft(QPointF(-itemRect.width()*0.5, -itemRect.height()*0.5));
+  QRectF itemRect(-newWidth*0.5, -rect().height()*0.5,
+                  newWidth, rect().height());
 
   // we don't now what the parents's origin is, so, add .x() and .y()
   setPos(relativeCenter().x() * newParentRect.width() + newParentRect.x(),
--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #1007684:1007685
@@ -686,8 +686,7 @@
     painter->drawRect(rect());
     painter->restore();
 
-  //painter->drawPixmap(QPointF(0, 0), _plotPixmap);
-  painter->drawPixmap(rect().topLeft(), _plotPixmap);
+    painter->drawPixmap(rect().topLeft(), _plotPixmap);
   }
 #if BENCHMARK
   int i = bench_time.elapsed();
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.cpp #1007684:1007685
@@ -1217,7 +1217,7 @@
 QTransform ViewItem::selectTransform() const {
 
   /* Converts a point on the rect() to a point on the selectBoundingRect()
-     or the inverse by using selectTransform().inverted()...
+     or the inverse by using selectTransform().inverted().
   */
 
   QRectF from = rect();
--- branches/work/kst/portto4/kst/src/libkstapp/viewitemdialog.cpp #1007684:1007685
@@ -384,10 +384,7 @@
   qreal rotation = _dimensionsTab->rotationDirty() ? _dimensionsTab->rotation() :item->rotationAngle();
 
   QTransform transform;
-  QPointF origin = item->centerOfRotation();
-  transform.translate(origin.x(), origin.y());
   transform.rotate(rotation);
-  transform.translate(-origin.x(), -origin.y());
 
   item->setTransform(transform);
   item->updateRelativeSize();


More information about the Kst mailing list