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

Barth Netterfield netterfield at astro.utoronto.ca
Tue Nov 3 00:29:50 CET 2009


SVN commit 1044082 by netterfield:

Fix little buglet with plot sizes from data wizard.


 M  +2 -0      devel-docs/Kst2Specs/Bugs  
 M  +0 -1      src/datasources/ascii/ascii.cpp  
 M  +23 -14    src/libkstapp/datawizard.cpp  
 M  +1 -1      src/libkstapp/plotitem.cpp  


--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Bugs #1044081:1044082
@@ -9,4 +9,6 @@
 
 Artifacts when resizing large arrowheads.
 
+--------------------
 
+Segfault on exit if there is a shared axis box.
--- branches/work/kst/portto4/kst/src/datasources/ascii/ascii.cpp #1044081:1044082
@@ -197,7 +197,6 @@
 
 
 AsciiSource::~AsciiSource() {
-  qDebug() << "xxx deleting an ascii source";
   if (_tmpBuf) {
     free(_tmpBuf);
     _tmpBuf = 0L;
--- branches/work/kst/portto4/kst/src/libkstapp/datawizard.cpp #1044081:1044082
@@ -710,10 +710,12 @@
    }
   }
 
+
   // create the necessary plots
   QList<PlotItem*> plotList;
   PlotItem *plotItem = 0;
   bool relayout = true;
+  int plotsInPage = _document->currentView()->scene()->items().count();
   switch (_pagePlot->curvePlacement()) {
     case DataWizardPagePlot::ExistingPlot:
     {
@@ -941,22 +943,29 @@
   //double fontScale = ApplicationSettings::self()->referenceFontSize()/sqrt((double) plotList.count()) -
   //                   ApplicationSettings::self()->referenceFontSize()+
   //                   ApplicationSettings::self()->referenceFontSize()/3;
-  double fontScale = ApplicationSettings::self()->referenceFontSize()/sqrt((double) plotList.count())-
-                     ApplicationSettings::self()->referenceFontSize() +
-                     _dialogDefaults->value("plot/globalFontScale",0.0).toDouble();
 
-  //if (fontScale > 0)  {
-  //  fontScale = 0;
-  //}
+  double fontScale;
+  if (plotsInPage==0) {
+    plotsInPage = plotList.count();
+    if (plotsInPage==0) plotsInPage = 1;
+    fontScale = ApplicationSettings::self()->referenceFontSize()/sqrt((double)plotsInPage)-
+                       ApplicationSettings::self()->referenceFontSize() +
+                       _dialogDefaults->value("plot/globalFontScale",0.0).toDouble();
+    foreach (PlotItem* plot, plotList) {
+      plot->setGlobalFontScale(fontScale);
+      plot->leftLabelDetails()->setFontScale(fontScale);
+      plot->rightLabelDetails()->setFontScale(fontScale);
+      plot->topLabelDetails()->setFontScale(fontScale);
+      plot->bottomLabelDetails()->setFontScale(fontScale);
+      plot->numberLabelDetails()->setFontScale(fontScale);
+    }
+  } else {
+    foreach (PlotItem* plot, plotList) {
+      _document->currentView()->configurePlotFontDefaults(plot); // copy plots already in window
+    }
+  }
 
   foreach (PlotItem* plot, plotList) {
-    plot->setGlobalFontScale(fontScale);
-    plot->leftLabelDetails()->setFontScale(fontScale);
-    plot->rightLabelDetails()->setFontScale(fontScale);
-    plot->topLabelDetails()->setFontScale(fontScale);
-    plot->bottomLabelDetails()->setFontScale(fontScale);
-    plot->numberLabelDetails()->setFontScale(fontScale);
-
     if (!xLabels) {
       plot->leftLabelDetails()->setText(QString(" "));
       plot->rightLabelDetails()->setText(QString(" "));
@@ -971,7 +980,7 @@
 
   }
 
-  fontScale = ApplicationSettings::self()->referenceFontSize()/sqrt((double) plotList.count())-
+  fontScale = ApplicationSettings::self()->referenceFontSize()/sqrt((double) plotsInPage)-
                      ApplicationSettings::self()->referenceFontSize() +
                      _dialogDefaults->value("legend/fontScale",0.0).toDouble();
 
--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #1044081:1044082
@@ -116,7 +116,7 @@
   _bottomLabelDetails = new PlotLabel(this);
   _numberLabelDetails = new PlotLabel(this);
 
-  parentView()->configurePlotFontDefaults(this);
+  //parentView()->configurePlotFontDefaults(this);
 
   connect(_leftLabelDetails, SIGNAL(labelChanged()), this, SLOT(setPlotBordersDirty()));
   connect(_leftLabelDetails, SIGNAL(labelChanged()), this, SLOT(setLeftLabelDirty()));


More information about the Kst mailing list