Summary: | mouse data doesn't change as live data is scrolling by | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Matthew Truch <matt> |
Component: | general | Assignee: | George Staikos <staikos> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Matthew Truch
2003-09-25 03:47:01 UTC
Working on the patch for this now. Subject: kdeextragear-2/kst CVS commit by staikos: This seems to update the mouse properly. CCMAIL: 64891-done@bugs.kde.org M +23 -0 kst/kstview.cpp 1.47 M +4 -3 tests/datagenerator.pl 1.2 --- kdeextragear-2/kst/kst/kstview.cpp #1.46:1.47 @@ -364,4 +364,27 @@ void KstView::update() { needrecreate = true; paintEvent(NULL); + int plot = MouseInfo->getPlotNum(); + if (plot >= 0) { + KstPlot* pPlot = KST::plotList.at(plot); + QRect plot_rect = pPlot->GetPlotRegion(); + QPoint pos = mapFromGlobal(QCursor::pos()); + double xmin, ymin, xmax, ymax, xpos, ypos; + pPlot->getLScale(xmin, ymin, xmax, ymax); + xpos = (double)(pos.x() - plot_rect.left())/(double)plot_rect.width(); + xpos = xpos * (xmax - xmin) + xmin; + ypos = (double)(pos.y() - plot_rect.top())/(double)plot_rect.height(); + ypos = ypos * (ymin - ymax) + ymax; + + if (pPlot->isXLog()) { + xpos = pow(10.0, xpos); + } + + if (pPlot->isYLog()) { + ypos = pow(10.0, ypos); + } + + QString msg = i18n("(%1, %2)").arg(xpos,0,'G').arg(ypos,0,'G'); + emit newDataMsg(msg); + } } --- kdeextragear-2/kst/tests/datagenerator.pl #1.1:1.2 @@ -9,9 +9,10 @@ while (true) { print OUTPUT "$i "; - print OUTPUT sin($i) + rand(0.4) - 0.2; + $ii = $i/10; + print OUTPUT sin($ii) + rand(0.4) - 0.2; print OUTPUT " "; - print OUTPUT cos($i) + rand(0.4) - 0.2; + print OUTPUT cos($ii) + rand(0.4) - 0.2; print OUTPUT " "; - print OUTPUT sin($i * $i) * (cos($i) + rand(0.4) - 0.2); + print OUTPUT sin($ii * $ii) * (cos($ii) + rand(0.4) - 0.2); print OUTPUT " "; print OUTPUT "\n"; |