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

Barth Netterfield netterfield at astro.utoronto.ca
Mon Jan 12 20:57:09 CET 2009


SVN commit 910169 by netterfield:

constant y value curves have more sensible limits in auto mode.



 M  +2 -2      kst.pro  
 M  +1 -0      src/libkstapp/plotitem.cpp  
 M  +1 -0      src/libkstapp/plotitem.h  
 M  +20 -5     src/libkstapp/plotrenderitem.cpp  
 M  +1 -0      src/widgets/widgets.pro  


--- branches/work/kst/portto4/kst/kst.pro #910168:910169
@@ -1,5 +1,5 @@
 TEMPLATE = subdirs
-CONFIG += ordered
+CONFIG += ordered debug qt thread
 
 SUBDIRS += \
     src/libkst \
@@ -11,4 +11,4 @@
     src/d2asc \
     src/plugins
 
-!win32:SUBDIRS += tests
\ No newline at end of file
+!win32:SUBDIRS += tests
--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #910168:910169
@@ -509,6 +509,7 @@
 
 
 void PlotItem::paint(QPainter *painter) {
+  qDebug() << "Plot Item Paint";
   if (isInSharedAxisBox()) {
     setBrush(Qt::transparent);
   } else {
--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.h #910168:910169
@@ -1,3 +1,4 @@
+
 /***************************************************************************
  *                                                                         *
  *   copyright : (C) 2007 The University of Toronto                        *
--- branches/work/kst/portto4/kst/src/libkstapp/plotrenderitem.cpp #910168:910169
@@ -649,8 +649,8 @@
 void PlotRenderItem::computeAuto(Qt::Orientation orientation, qreal *min, qreal *max) const {
   //The previous values are of no consequence as this algorithm does not depend
   //on the previous values.  So start over so that first active relation initializes.
-  qreal minimum;
-  qreal maximum;
+  qreal minimum=-0.1;
+  qreal maximum= 0.1;;
   bool unInitialized = true;
 
   bool axisLog = orientation == Qt::Horizontal ? plotItem()->xAxis()->axisLog() : plotItem()->yAxis()->axisLog();
@@ -675,9 +675,24 @@
       unInitialized = false;
   }
 
-  if (unInitialized || maximum <= minimum) {
-    minimum = axisLog ? 0.0 : -0.1;
-    minimum = 0.1;
+  if (axisLog) {
+    if (unInitialized){ 
+      maximum = 100.0;
+      minimum = 0.01;
+    }
+    if (minimum < 0) {
+      minimum = 0;
+    }
+    if (minimum >= maximum) {
+      if (minimum <=0) maximum = 1;
+      else maximum = minimum * 1.1;
+      minimum = minimum * 0.9;
+    }
+  } else {
+    if (maximum <= minimum) {
+      minimum = maximum -0.1;
+      maximum += 0.1;
+    }
   }
 
   *min = minimum;
--- branches/work/kst/portto4/kst/src/widgets/widgets.pro #910168:910169
@@ -9,6 +9,7 @@
 TARGET = kstwidgets
 win32:CONFIG += staticlib
 
+
 target.path = $$[QT_INSTALL_PLUGINS]/designer
 INSTALLS += target
 


More information about the Kst mailing list