DraggingByMiddleButton = 0x0010,
ImmediateContextMenu = 0x0020,
ImmediateSelection = 0x0040,
- Sketching = 0x0080
+ Sketching = 0x0080,
+
+ GlobalWheelScaling = 0x0100
};
Q_DECLARE_FLAGS( InteractionFlags, InteractionFlag )
{
if( GraphicsView_ViewPort* aViewPort = getActiveViewPort() )
{
+ if( aViewPort->hasInteractionFlag( GraphicsView_ViewPort::GlobalWheelScaling ) )
+ {
+ const double d = 1.05;
+ double q = pow( d, e->delta()/120 );
+ QGraphicsView::ViewportAnchor old_anchor = aViewPort->transformationAnchor();
+ aViewPort->setTransformationAnchor( QGraphicsView::AnchorUnderMouse );
+ aViewPort->scale( q, q );
+ aViewPort->setTransformationAnchor( old_anchor );
+ }
+
if( aViewPort->hasInteractionFlag( GraphicsView_ViewPort::WheelScaling ) )
{
bool anIsScaleUp = e->delta() > 0;