[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Mon Oct 20 11:37:32 CEST 2003
CVS commit by staikos:
*finally* straighten out the log-log graph coordinates in data mode. I think
this is the last data mode bug to fix before 0.93
M +6 -2 kstview.cpp 1.55
--- kdeextragear-2/kst/kst/kstview.cpp #1.54:1.55
@@ -405,5 +405,9 @@ void KstView::updateMouse() {
for (KstBaseCurveList::Iterator i = pPlot->Curves.begin(); i != pPlot->Curves.end(); ++i) {
double xpt = 0.0, ypt = 0.0;
- (*i)->getPoint(int(xpos), xpt, ypt);
+ if (pPlot->isXLog()) {
+ (*i)->getPoint((*i)->sampleCount() * xpos / ((*i)->maxX() - (*i)->minX()), xpt, ypt);
+ } else {
+ (*i)->getPoint(xpos, xpt, ypt);
+ }
if (fabs(ypos - ypt) < delta) {
delta = fabs(ypos - ypt);
@@ -413,5 +417,5 @@ void KstView::updateMouse() {
}
if (curve.data()) {
- msg = i18n("%3 (%1, %2)").arg(int(xpos)).arg(newypos,0,'G').arg(curve->tagName());
+ msg = i18n("%3 (%1, %2)").arg(xpos).arg(newypos,0,'G').arg(curve->tagName());
emit newDataMsg(msg);
return;
More information about the Kst
mailing list