Bug 115966 - Error bar tails are too wide
Summary: Error bar tails are too wide
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-09 00:58 UTC by Matthew Truch
Modified: 2005-11-09 03:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of borked error bars. (17.68 KB, image/png)
2005-11-09 01:00 UTC, Matthew Truch
Details
.kst file demonstrating the problemo. (7.06 KB, text/plain)
2005-11-09 01:40 UTC, Matthew Truch
Details
Data for .kst file attached (10.21 KB, text/plain)
2005-11-09 01:40 UTC, Matthew Truch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Truch 2005-11-09 00:58:41 UTC
Version:           1.2.0_svn_478969 (using KDE KDE 3.4.1)
Installed from:    Fedora RPMs
OS:                Linux

Currently, when you plot error bars, the tails of the error bars are drawn to the entire width of the  plot, not to a normal nice small width.  All these error bar tails jumble over the plot making an ugly mess.  The tails should be small, as the used to be.
Comment 1 Matthew Truch 2005-11-09 01:00:32 UTC
Created attachment 13350 [details]
Screenshot of borked error bars.

A screenshot of 5 plots with ~50 points per plot with error bars showing the
tails being draw to the full width of the plot window.
Comment 2 George Staikos 2005-11-09 01:36:19 UTC
Can you attach a .kst file with data (or that reads from a simple ascii file) 
that demonstrates?  If it's a regression, it's probably my fault, and I can 
fix.
Comment 3 Matthew Truch 2005-11-09 01:40:00 UTC
Created attachment 13351 [details]
.kst file demonstrating the problemo.

Attached a kst file demonstrating the bug.
Comment 4 Matthew Truch 2005-11-09 01:40:54 UTC
Created attachment 13352 [details]
Data for .kst file attached

Data for the previously attached kst file
Comment 5 George Staikos 2005-11-09 02:45:00 UTC
Problem is that KstPoint::dim() is wrong.
Comment 6 Matthew Truch 2005-11-09 03:17:36 UTC
SVN commit 479063 by truch:

width + height / 400 != (width + height) / 400

BUG: 115966


 M  +1 -1      kstpoint.cpp  


--- trunk/extragear/graphics/kst/kst/kstpoint.cpp #479062:479063
@@ -152,7 +152,7 @@
 
 int KstPoint::dim(QPainter *p) const {
   QRect r = p->window();
-  return kMax(1, (r.width() + r.height() / 400));
+  return kMax(1, ((r.width() + r.height()) / 400));
 }
 
 // vim: ts=2 sw=2 et
Comment 7 George Staikos 2005-11-09 03:21:36 UTC
SVN commit 479065 by staikos:

at least a temporary workaround for the error bar bug
The question is, what was this -supposed- to do?  I can't make any sense out of
KstPoint::dim() and I'm not even sure why it was used here.  I hardcoded the
value to 5.  The same will need to be applied elsewhere if it's OK.
CCBUG: 115966


 M  +3 -2      kstvcurve.cpp  


--- trunk/extragear/graphics/kst/kst/kstvcurve.cpp #479064:479065
@@ -1439,12 +1439,13 @@
           int X1i = d2i(X1);
           int Y1i = d2i(Y1);
           int Y2i = d2i(Y2);
+          int w = 6;
           p->drawLine(X1i, Y1i, X1i, Y2i);
           if (do_low_flag) {
-            p->drawLine(X1i + Point.dim(p), Y1i, X1i - Point.dim(p), Y1i);
+            p->drawLine(X1i + w, Y1i, X1i - w, Y1i);
           }
           if (do_high_flag) {
-            p->drawLine(X1i + Point.dim(p), Y2i, X1i - Point.dim(p), Y2i);
+            p->drawLine(X1i + w, Y2i, X1i - w, Y2i);
           }
         }
       }
Comment 8 Netterfield 2005-11-09 03:25:44 UTC
Matt just submitted the correct fix.  Go ahead and revert this.

cbn

On November 8, 2005 09:21 pm, George Staikos wrote:
[bugs.kde.org quoted mail]
Comment 9 George Staikos 2005-11-09 03:27:47 UTC
On Tuesday 08 November 2005 21:17, Matthew Truch wrote:
> SVN commit 479063 by truch:
>
> width + height / 400 != (width + height) / 400


  Ooops!!!  Nice catch.  I even re-read that twice and still didn't spot it.  
I will revert my change.  Thanks for the fix.