[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Jun 18 17:43:29 CEST 2004


CVS commit by staikos: 

- re-add my debugging hooks
- the semantic problem with label dragging still exists


  M +11 -1     kst2dplot.cpp   1.98


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.97:1.98
@@ -2086,13 +2086,16 @@ void Kst2DPlot::mouseMoveEvent(QWidget *
     KstLabel *label = labelList.at(i_label);
     if (label) {
+#define LABEL_TRANSPARENT
       QRegion oldExtents = label->extents;
       QPixmap pm(GetWinRegion().width(), GetWinRegion().height());
       QRect rectBounding = oldExtents.boundingRect();
-      QBitmap bm(GetWinRegion().width(), GetWinRegion().height(), true);
 
+#ifdef LABEL_TRANSPARENT
+      QBitmap bm(GetWinRegion().width(), GetWinRegion().height(), true);
       { // Scope is needed to kill off painter before we resize
         QPainter p(&bm);
         label->draw(p, 0, label->v_offset, false);
       }
+#endif
 
       pm.fill(KstSettings::globalSettings()->backgroundColor);
@@ -2117,6 +2120,8 @@ void Kst2DPlot::mouseMoveEvent(QWidget *
 
       pm.resize(iWidth, iHeight);
+#ifdef LABEL_TRANSPARENT
       bm.resize(iWidth, iHeight);
       pm.setMask(bm);
+#endif
 
       label->extents = oldExtents; // restore them in case the drag is canceled
@@ -2535,4 +2540,9 @@ void Kst2DPlot::mouseReleaseEvent(QWidge
 
   } else if (_mouse.mode == LABEL_TOOL) {
+    // FIXME: semantic problem here.  If we trigger on mouse press, then we
+    //        break label dragging.  If we trigger on mouse release, then if
+    //        a drag is cancelled with Escape, the release event fires through
+    //        and we open the label editor (incorrectly).
+
     plotregion = GetPlotRegion();
 





More information about the Kst mailing list