[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Sep 12 04:37:58 CEST 2003


CVS commit by staikos: 

eliminate the garbage in the drag pixmap.  Unfortunately it still doesn't paint
into the pixmap properly so we get a blank pixmap, or a pixmap with tiny
writing in it now.  Will have to debug this later.


  M +14 -15    kstlabel.cpp   1.14
  M +1 -0      kstview.cpp   1.31


--- kdeextragear-2/kst/kst/kstlabel.cpp  #1.13:1.14
@@ -19,6 +19,6 @@
 #include <stdio.h>
 #include <math.h>
-#include <iostream>
 
+#include <kdebug.h>
 #include <qptrlist.h>
 #include <qtextstream.h>
@@ -113,6 +113,5 @@ typedef struct GreekCharType {
 
 
-void KstLabel::draw(QPainter &p, int px, int py,
-                    bool doDraw) {
+void KstLabel::draw(QPainter &p, int px, int py, bool doDraw) {
   int w,h;
   int s;
@@ -157,5 +156,5 @@ void KstLabel::draw(QPainter &p, int px,
   p.save();
   p.setFont(TextFont);
-  p.translate(px,py);
+  p.translate(px, py);
 
   p.setClipping(false);
@@ -177,37 +176,37 @@ void KstLabel::draw(QPainter &p, int px,
 
   switch (Justify) {
-      case (CxBy):
+      case CxBy:
         x = -w/2;
         break;
-      case (CxTy):
+      case CxTy:
         x = -w/2;
         y = h;
         break;
-      case (CxCy):
+      case CxCy:
         x = -w/2;
         y = h/2;
         break;
-      case (LxBy):
+      case LxBy:
         break;
-      case (LxTy):
+      case LxTy:
         y = h;
         break;
-      case (LxCy):
+      case LxCy:
         y = h/2;
         break;
-      case (RxBy):
+      case RxBy:
         x = -w;
         break;
-      case (RxTy):
+      case RxTy:
         x = -w;
         y = h;
         break;
-      case (RxCy):
+      case RxCy:
         x = -w;
         y = h/2;
         break;
       default:
-        std::cerr << "Warning: undefined KstJustify in kstlabel::draw: "
-             << Justify << "\n";
+        kdWarning() << "undefined KstJustify in kstlabel::draw: "
+             << Justify << endl;
         break;
   }

--- kdeextragear-2/kst/kst/kstview.cpp  #1.30:1.31
@@ -366,4 +366,5 @@ void KstView::mouseMoveEvent(QMouseEvent
     KstLabel *label = plot->labelList.at(i_label);
     QPixmap pm(label->extents.width(), label->extents.height());
+    pm.fill();
     QPainter p(&pm);
     label->draw(p, 0, 0, true);




More information about the Kst mailing list