[Kst] extragear/graphics/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Sat Oct 22 19:34:13 CEST 2005


SVN commit 473112 by netterfield:

Start to fix rotated labels... not done yet.
Copy only grabs numbers, not the parenthesis.



 M  +13 -3     kst2dplot.cpp  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #473111:473112
@@ -429,6 +429,7 @@
 
 
 // FIXME: broken copy constructor
+// what is broken?
 Kst2DPlot::Kst2DPlot(const Kst2DPlot& plot, const QString& name)
 : KstPlotBase(plot), _buffer(8) {
   QString plotName;
@@ -1992,7 +1993,7 @@
 #endif
   int tpxLabelCount = tpx.labels.count();
   int tpyLabelCount = tpy.labels.count();
-  // FIXME: make more efficient
+  
   _fullTickLabel->setText(tpx.labels[0]);
   int xFullTickLabelWidth = _fullTickLabel->size().width();
   _fullTickLabel->setText(tpy.labels[0]);
@@ -2184,6 +2185,7 @@
 void Kst2DPlot::updateDirtyFromLabels() {
   bool dirty = this->dirty();
   // FIXME: dirty for xlabel, ylabel, toplabel
+  // don't know what there is to fix... plotlabels no longer cache (and don't need to).
   //dirty = dirty || XLabel->dirty() || YLabel->dirty() || TopLabel->dirty();
 #if 0
   XLabel->setDirty(false);
@@ -2395,7 +2397,6 @@
   }
 
   // only attempt to draw if plot is big enough
-  //kstdDebug () << tagName() << ": x_px = " << x_px << " xright_bdr_px = " << xright_bdr_px << " xleft_bdr_px = " << xleft_bdr_px << " y_px = " << y_px << " ybot_bdr_px = " << ybot_bdr_px << " ytop_bdr_px = " << ytop_bdr_px << endl;
   if (x_px - xright_bdr_px - xleft_bdr_px >= 10.0 &&
       y_px - ybot_bdr_px - ytop_bdr_px + 1.0 - ytop_bdr_px >= 10.0) {
     Lx = RelPlotRegion.left();
@@ -5225,7 +5226,8 @@
 
   // FIXME: we should also provide a custom mime source so that we can
   //        actually manipulate points of data within Kst.
-  QString msg = i18n("(%1, %2)").arg(_copy_x, 0, 'G').arg(_copy_y, 0, 'G');
+  // FIXME: if we are over an image, we should also return Z.
+  QString msg = i18n("%1 %2").arg(_copy_x, 0, 'G').arg(_copy_y, 0, 'G');
   QApplication::clipboard()->setText(msg);
 }
 
@@ -5707,8 +5709,16 @@
         _xTickLabel->paint(p);
         p.restore();
       } else if (_xTickLabel->rotation() > 0) {
+        p.save();
+        p.translate(d2i(xTickPos), yTickPos);
+        _xTickLabel->paint(p);
+        p.restore();
         // FIXME XTickLabel->draw(p, d2i(xTickPos + (0.5 * XTickLabel->rotatedWidth(p))), d2i(y_px - ybot_bdr_px + 0.4*XTickLabel->rotatedHeight(p)));
       } else if (_xTickLabel->rotation() < 0) {
+        p.save();
+        p.translate(d2i(xTickPos) - _xTickLabel->size().width(), yTickPos);
+        _xTickLabel->paint(p);
+        p.restore();
         // FIXME XTickLabel->draw(p, d2i(xTickPos - (0.5 * XTickLabel->rotatedWidth(p))), d2i(y_px - ybot_bdr_px + 0.4 * XTickLabel->rotatedHeight(p)));
       }
     }


More information about the Kst mailing list