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

Barth Netterfield netterfield at astro.utoronto.ca
Mon Jun 18 22:31:43 UTC 2012


SVN commit 1301738 by netterfield:

Make sure to reset render contect font size if the label ends with a
superscript or subscript.

Fixes the 'polynomial label' bug.


 M  +0 -2      labelitem.cpp  
 M  +6 -0      labelrenderer.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/labelitem.cpp #1301737:1301738
@@ -92,7 +92,6 @@
     Label::renderLabel(*_labelRc, parsed->chunk, true, false);
 
     _height = _labelRc->fontHeight();
-
     // Make sure we have a rect for selection, movement, etc
     if (_resized) {
       _resized = false;
@@ -261,7 +260,6 @@
 }
 
 void CreateLabelCommand::createItem(QString *inText) {
-
   if (inText) {
     _item = new LabelItem(_view, *inText);
   } else {
--- branches/work/kst/portto4/kst/src/libkstapp/labelrenderer.cpp #1301737:1301738
@@ -218,6 +218,12 @@
     fi = fi->next;
   }
 
+  QFont f = rc.font();
+  if (rc.fontSize() != oldSize) {
+    f.setPointSizeF(oldSize);
+    rc.setFont(f);
+  }
+
   rc.size = oldSize;
   rc.y = oldY;
 }


More information about the Kst mailing list