Bug 65278 - kst crashes when zooming too far
Summary: kst crashes when zooming too far
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: George Staikos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-01 00:02 UTC by tnagy
Modified: 2004-11-21 04:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tnagy 2003-10-01 00:02:09 UTC
Version:           kdeextragear-2-030930 (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.3.1 -O3 -march=athlon-xp
OS:          Linux

In kst :

first create a plot :
* data manager -> equation 
* scalar : new scalar X, with value 12
* equation X*X
* apply

then zoom :
* click on the middle of the graph
* move the pointer on the right out of the window
* crash
Comment 1 George Staikos 2003-10-02 04:32:18 UTC
Nice catch :) 
Comment 2 George Staikos 2003-10-02 06:37:29 UTC
Subject: kdeextragear-2/kst/kst

CVS commit by staikos: 

This was the result of a misguided patch.  Unfortunately KstMouse will make it
overly complicated to add more mouse modes in the future due to its concept of
"plotNum".  It might be a good idea to store more stateful information, and
actually have the plotNum reflect the plot it's actually in.  I think this
could simplify KstView somewhat too.  Anyways, something to think about for the
future.

CCMAIL: 65278-done@bugs.kde.org


  M +3 -3      kstview.cpp   1.52


--- kdeextragear-2/kst/kst/kstview.cpp  #1.51:1.52
@@ -504,14 +504,14 @@ void KstView::mouseMoveEvent(QMouseEvent
   }
 
-  MouseInfo->setPlotNum(-1);
-
   for (i = i0; i < iN; i++) {
     QRect plot_rect = KST::plotList.at(i)->GetPlotRegion();
     if (plot_rect.contains(e->pos())) {
-      MouseInfo->setPlotNum(i);
       if (MouseInfo->getMode() == INACTIVE) {
+        MouseInfo->setPlotNum(i);
         if (i != plot_num) {
           updateTieBoxes(this);
         }
+      } else if (MouseInfo->getMode() == LABEL_TOOL) {
+        MouseInfo->setPlotNum(i);
       }
       in_plot = true;