Bug 125328 - off by one error in selection in layout mode
Summary: off by one error in selection in layout mode
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-11 01:33 UTC by Matthew Truch
Modified: 2006-05-05 02:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Truch 2006-04-11 01:33:25 UTC
Version:           1.2.1 (using KDE KDE 3.5.1)
OS:                Linux

When in layout mode, there is a small region near the edge of objects where you cannot select or move them.  This is indicated by a plain arrow (indicating that kst couldn't find anything underneath to select).  Probably an off-by-one or corner case.
Comment 1 Andrew Walker 2006-05-03 17:35:35 UTC
A more specific problem I see is as follows:

Create a plot
Create a box within it
Switch to layout mode
Move the cursor to inside the box
Slowly move the cursor outside of the box but remain within the plot

RESULTS:
For a short distance the cursor will be the standard arrow cursor

EXPECTED RESULTS:
The cursor should always be the move cursor (with the focus rectangles drawn to show which object has the focus)
Comment 2 Andrew Walker 2006-05-05 02:26:30 UTC
SVN commit 537517 by arwalker:

BUG:125328 Set the cursor correctly even when switching focus objects

 M  +11 -20    ksttoplevelview.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/ksttoplevelview.cpp #537516:537517
@@ -210,33 +210,24 @@
     }
   }
   if (p) {
-    setCursorFor(pos, p);
     if (p->focused()) {
+      setCursorFor(pos, p);
       _focusOn = true; // just in case - seems to be false on occasion
       return;
     }
+    p->setFocus(true);
     if (_focusOn) { // something else has the focus, clear it
-      p->setFocus(true);
       clearFocus();
-      KstPainter painter;
-      painter.begin(_w);
-      painter.setRasterOp(Qt::NotROP);
-      painter.setPen(QPen(Qt::black, 0, Qt::SolidLine));
-      painter.setBrush(Qt::NoBrush);
-      p->drawFocusRect(painter);
-      painter.end();
-      _focusOn = true;
-    } else {
-      p->setFocus(true);
-      KstPainter painter;
-      painter.begin(_w);
-      painter.setRasterOp(Qt::NotROP);
-      painter.setPen(QPen(Qt::black, 0, Qt::SolidLine));
-      painter.setBrush(Qt::NoBrush);
-      p->drawFocusRect(painter);
-      painter.end();
-      _focusOn = true;
     }
+    setCursorFor(pos, p);
+    KstPainter painter;
+    painter.begin(_w);
+    painter.setRasterOp(Qt::NotROP);
+    painter.setPen(QPen(Qt::black, 0, Qt::SolidLine));
+    painter.setBrush(Qt::NoBrush);
+    p->drawFocusRect(painter);
+    painter.end();
+    _focusOn = true;
     _hoverFocus = p;
   } else {
     clearFocus();