File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,17 @@ QgsComposerMouseHandles::MouseAction QgsComposerMouseHandles::mouseActionForPosi
439
439
bool nearLowerBorder = false ;
440
440
bool nearUpperBorder = false ;
441
441
442
+ bool withinWidth = false ;
443
+ bool withinHeight = false ;
444
+ if ( itemCoordPos.x () >= 0 && itemCoordPos.x () <= rect ().width () )
445
+ {
446
+ withinWidth = true ;
447
+ }
448
+ if ( itemCoordPos.y () >= 0 && itemCoordPos.y () <= rect ().height () )
449
+ {
450
+ withinHeight = true ;
451
+ }
452
+
442
453
double borderTolerance = rectHandlerBorderTolerance ();
443
454
444
455
if ( itemCoordPos.x () >= 0 && itemCoordPos.x () < borderTolerance )
@@ -474,19 +485,19 @@ QgsComposerMouseHandles::MouseAction QgsComposerMouseHandles::mouseActionForPosi
474
485
{
475
486
return QgsComposerMouseHandles::ResizeRightDown;
476
487
}
477
- else if ( nearLeftBorder )
488
+ else if ( nearLeftBorder && withinHeight )
478
489
{
479
490
return QgsComposerMouseHandles::ResizeLeft;
480
491
}
481
- else if ( nearRightBorder )
492
+ else if ( nearRightBorder && withinHeight )
482
493
{
483
494
return QgsComposerMouseHandles::ResizeRight;
484
495
}
485
- else if ( nearUpperBorder )
496
+ else if ( nearUpperBorder && withinWidth )
486
497
{
487
498
return QgsComposerMouseHandles::ResizeUp;
488
499
}
489
- else if ( nearLowerBorder )
500
+ else if ( nearLowerBorder && withinWidth )
490
501
{
491
502
return QgsComposerMouseHandles::ResizeDown;
492
503
}
You can’t perform that action at this time.
0 commit comments