Bug 129061 - Axis displays no numbers or tick marks
Summary: Axis displays no numbers or tick marks
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-12 20:06 UTC by Andrew Walker
Modified: 2006-06-12 20:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2006-06-12 20:06:13 UTC
Version:           1.2.1 (using KDE KDE 3.5.0)
Installed from:    Compiled From Sources
OS:                Linux

PROBLEM:
Both the x-axis and y-axis can in some circumstances display neither tick marks or numbers.

STEPS TO REPRODUCE:
Start Kst
Create a plot
Move the cursor within the plot
Hold down the SHIFT and '>' keys to zoom out

RESULTS:
When the axes eventually reach 10^-308 and 10^308 they will then display
neither numbers nor tick marks.

EXPECTED RESULTS:
When the axes eventually reach 10^-308 and 10^308 they will stop there and
no further zooming out will be possible
Comment 1 Andrew Walker 2006-06-12 20:08:11 UTC
SVN commit 550775 by arwalker:

BUG:129061 Prevent axes zooming out beyond sensible range

 M  +7 -4      kst2dplot.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.cpp #550774:550775
@@ -701,9 +701,8 @@
 
 
 bool Kst2DPlot::checkLRange(double &min_in, double &max_in, bool bIsLog, double logBase) {
-  double diff  = fabs(1000.0 * min_in) * DBL_EPSILON;
   bool rc = true;
-
+  
   if (bIsLog) {
     if (isnan(pow(logBase, min_in)) || isnan(pow(logBase, max_in)) ||
         isinf(pow(logBase, min_in)) || isinf(pow(logBase, max_in))) {
@@ -714,8 +713,12 @@
     rc = false;
   }
 
-  if (rc && max_in <= min_in + diff) {
-    max_in = min_in + diff;
+  if (rc) {
+    double diff = fabs(1000.0 * min_in) * DBL_EPSILON;
+
+    if (max_in <= min_in + diff) {
+      max_in = min_in + diff;
+    }
   }
 
   return rc;