Changeset - 09bde1185cf5
[Not reviewed]
default
0 1 0
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-11-07 16:34:28
hy@ozderya.net
disable snapping with shift key
1 file changed with 8 insertions and 5 deletions:
0 comments (0 inline, 0 general)
scalepicker.cpp
Show inline comments
 
@@ -102,13 +102,16 @@ bool ScalePicker::eventFilter(QObject* o
 
        QMouseEvent* mouseEvent = (QMouseEvent*) event;
 
        double posPx = this->positionPx(mouseEvent);
 

	
 
        // do snapping
 
        for (double sp : snapPoints)
 
        // do snapping unless Shift is pressed
 
        if (! (mouseEvent->modifiers() & Qt::ShiftModifier))
 
        {
 
            if (fabs(posPx-sp) <= SNAP_DISTANCE)
 
            for (double sp : snapPoints)
 
            {
 
                posPx = sp;
 
                break;
 
                if (fabs(posPx-sp) <= SNAP_DISTANCE)
 
                {
 
                    posPx = sp;
 
                    break;
 
                }
 
            }
 
        }
 

	
0 comments (0 inline, 0 general)