| Summary: | Error bar tails are too wide | ||
|---|---|---|---|
| Product: | [Applications] kst | Reporter: | Matthew Truch <matt> |
| Component: | general | Assignee: | kst |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 1.x | ||
| Target Milestone: | --- | ||
| Platform: | Fedora RPMs | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Screenshot of borked error bars.
.kst file demonstrating the problemo. Data for .kst file attached |
||
|
Description
Matthew Truch
2005-11-09 00:58:41 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.
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. Created attachment 13351 [details]
.kst file demonstrating the problemo.
Attached a kst file demonstrating the bug.
Created attachment 13352 [details]
Data for .kst file attached
Data for the previously attached kst file
Problem is that KstPoint::dim() is wrong. 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
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);
}
}
}
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] 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. |