Skip to content
Permalink
Browse files

[composer] Switch to alt key for resize and draw from center mode

  • Loading branch information
nyalldawson committed Jul 27, 2014
1 parent 94919a1 commit c2f74c25fd0920522f97bb4561ca9f29dc74c394
Showing with 11 additions and 20 deletions.
  1. +6 −15 src/core/composer/qgscomposermousehandles.cpp
  2. +5 −5 src/gui/qgscomposerview.cpp
@@ -558,28 +558,19 @@ void QgsComposerMouseHandles::setViewportCursor( Qt::CursorShape cursor )

void QgsComposerMouseHandles::mouseMoveEvent( QGraphicsSceneMouseEvent* event )
{
bool shiftModifier = false;
bool controlModifier = false;
if ( event->modifiers() & Qt::ShiftModifier )
{
//shift key depressed
shiftModifier = true;
}
if ( event->modifiers() & Qt::ControlModifier )
{
//shift key depressed
controlModifier = true;
}

if ( mIsDragging )
{
//currently dragging a selection
dragMouseMove( event->lastScenePos(), shiftModifier, controlModifier );
//if shift depressed, constrain movement to horizontal/vertical
//if control depressed, ignore snapping
dragMouseMove( event->lastScenePos(), event->modifiers() & Qt::ShiftModifier, event->modifiers() & Qt::ControlModifier );
}
else if ( mIsResizing )
{
//currently resizing a selection
resizeMouseMove( event->lastScenePos(), shiftModifier, controlModifier );
//lock aspect ratio if shift depressed
//resize from center if alt depressed
resizeMouseMove( event->lastScenePos(), event->modifiers() & Qt::ShiftModifier, event->modifiers() & Qt::AltModifier );
}

mLastMouseEventPos = event->lastScenePos();
@@ -928,16 +928,16 @@ void QgsComposerView::mouseMoveEvent( QMouseEvent* e )
}

bool shiftModifier = false;
bool controlModifier = false;
bool altModifier = false;
if ( e->modifiers() & Qt::ShiftModifier )
{
//shift key depressed
shiftModifier = true;
}
if ( e->modifiers() & Qt::ControlModifier )
if ( e->modifiers() & Qt::AltModifier )
{
//control key depressed
controlModifier = true;
//alt key depressed
altModifier = true;
}

mMouseCurrentXY = e->pos();
@@ -1002,7 +1002,7 @@ void QgsComposerView::mouseMoveEvent( QMouseEvent* e )
case AddTable:
//adjust rubber band item
{
updateRubberBandRect( scenePoint, shiftModifier, controlModifier );
updateRubberBandRect( scenePoint, shiftModifier, altModifier );
break;
}

0 comments on commit c2f74c2

Please sign in to comment.
You can’t perform that action at this time.