summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjoye <joye>2014-06-02 19:58:46 (GMT)
committerjoye <joye>2014-06-02 19:58:46 (GMT)
commit03cb7456569ba0fdaeab16446eeb62f4d124b042 (patch)
tree60aed115cb078f4baa77107262112a70663c263a /src
parentc7f69dceaed915906668278c317c592721b938f9 (diff)
downloadblt-03cb7456569ba0fdaeab16446eeb62f4d124b042.zip
blt-03cb7456569ba0fdaeab16446eeb62f4d124b042.tar.gz
blt-03cb7456569ba0fdaeab16446eeb62f4d124b042.tar.bz2
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/bltGrBind.C16
-rw-r--r--src/bltGraph.C2
2 files changed, 13 insertions, 5 deletions
diff --git a/src/bltGrBind.C b/src/bltGrBind.C
index 58088ab..5476870 100644
--- a/src/bltGrBind.C
+++ b/src/bltGrBind.C
@@ -176,8 +176,8 @@ void BindTable::pickItem(XEvent* eventPtr)
// This implements a form of grabbing equivalent to what the X server does
// for windows.
- int buttonDown = state_ &
- (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask);
+ int buttonDown = state_
+ & (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask);
// Save information about this event in the widget. The event in the
// widget is used for two purposes:
@@ -226,6 +226,10 @@ void BindTable::pickItem(XEvent* eventPtr)
int y = pickEvent_.xcrossing.y;
newItem_ = pickPtr_->pickEntry(x, y, &newContext_);
}
+ else {
+ newItem_ =NULL;
+ newContext_ = CID_NONE;
+ }
// Nothing to do: the current item hasn't changed.
if ((newItem_ == currentItem_) && !(flags_ & LEFT_GRABBED_ITEM))
@@ -234,11 +238,15 @@ void BindTable::pickItem(XEvent* eventPtr)
if (!buttonDown)
flags_ &= ~LEFT_GRABBED_ITEM;
+ if ((newItem_ != currentItem_) && buttonDown) {
+ flags_ |= LEFT_GRABBED_ITEM;
+ return;
+ }
+
// Simulate a LeaveNotify event on the previous current item and an
// EnterNotify event on the new current item. Remove the "current" tag
// from the previous current item and place it on the new current item.
- if ((newItem_ != currentItem_) && currentItem_ &&
- !(flags_ & LEFT_GRABBED_ITEM)) {
+ if (currentItem_ && (newItem_ != currentItem_) && !(flags_ & LEFT_GRABBED_ITEM)) {
XEvent event = pickEvent_;
event.type = LeaveNotify;
diff --git a/src/bltGraph.C b/src/bltGraph.C
index 0d07dda..5b10622 100644
--- a/src/bltGraph.C
+++ b/src/bltGraph.C
@@ -1348,7 +1348,7 @@ ClientData Graph::pickEntry(int xx, int yy, ClassId* classIdPtr)
// Sample coordinate is in one of the graph margins. Can only pick an axis.
Region2d exts;
extents(&exts);
- if (xx >= exts.right || xx < exts.left || yy >= exts.bottom || yy < exts.top) {
+ if (xx>=exts.right || xx<exts.left || yy>=exts.bottom || yy<exts.top) {
Axis* axisPtr = nearestAxis(xx, yy);
if (axisPtr) {
*classIdPtr = axisPtr->classId();