Skip to content
Permalink
Browse files
[composer] Fix calculation of mouse action for position for mouse han…
…dles (refs #10143, tentative fix)
  • Loading branch information
nyalldawson committed May 31, 2014
1 parent 711aa16 commit 6dd4346c485ac0e3c690510913e1732fa41b153a
Showing with 15 additions and 4 deletions.
  1. +15 −4 src/core/composer/qgscomposermousehandles.cpp
@@ -439,6 +439,17 @@ QgsComposerMouseHandles::MouseAction QgsComposerMouseHandles::mouseActionForPosi
bool nearLowerBorder = false;
bool nearUpperBorder = false;

bool withinWidth = false;
bool withinHeight = false;
if ( itemCoordPos.x() >= 0 && itemCoordPos.x() <= rect().width() )
{
withinWidth = true;
}
if ( itemCoordPos.y() >= 0 && itemCoordPos.y() <= rect().height() )
{
withinHeight = true;
}

double borderTolerance = rectHandlerBorderTolerance();

if ( itemCoordPos.x() >= 0 && itemCoordPos.x() < borderTolerance )
@@ -474,19 +485,19 @@ QgsComposerMouseHandles::MouseAction QgsComposerMouseHandles::mouseActionForPosi
{
return QgsComposerMouseHandles::ResizeRightDown;
}
else if ( nearLeftBorder )
else if ( nearLeftBorder && withinHeight )
{
return QgsComposerMouseHandles::ResizeLeft;
}
else if ( nearRightBorder )
else if ( nearRightBorder && withinHeight )
{
return QgsComposerMouseHandles::ResizeRight;
}
else if ( nearUpperBorder )
else if ( nearUpperBorder && withinWidth )
{
return QgsComposerMouseHandles::ResizeUp;
}
else if ( nearLowerBorder )
else if ( nearLowerBorder && withinWidth )
{
return QgsComposerMouseHandles::ResizeDown;
}

0 comments on commit 6dd4346

Please sign in to comment.