From 13163fef304b9a7c70e1961703ec1826c9b42d52 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Mon, 20 Aug 2012 11:47:55 +0300 Subject: [PATCH] Frame size doesn't depends on zoom. --- src/domain/UBGraphicsItemDelegate.cpp | 7 +++++++ src/domain/UBGraphicsItemDelegate.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index f26d5ed1..962121a9 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -115,6 +115,7 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec , mToolBarUsed(useToolBar) { // NOOP + connect(UBApplication::boardController, SIGNAL(zoomChanged(qreal)), this, SLOT(onZoomChanged())); } void UBGraphicsItemDelegate::init() @@ -535,6 +536,12 @@ void UBGraphicsItemDelegate::commitUndoStep() } } +void UBGraphicsItemDelegate::onZoomChanged() +{ + mAntiScaleRatio = 1 / (UBApplication::boardController->systemScaleFactor() * UBApplication::boardController->currentZoom()); + + positionHandles(); +} void UBGraphicsItemDelegate::buildButtons() { diff --git a/src/domain/UBGraphicsItemDelegate.h b/src/domain/UBGraphicsItemDelegate.h index c45fd8be..fc5c460c 100644 --- a/src/domain/UBGraphicsItemDelegate.h +++ b/src/domain/UBGraphicsItemDelegate.h @@ -259,6 +259,8 @@ class UBGraphicsItemDelegate : public QObject void increaseZlevelTop(); void increaseZlevelBottom(); + void onZoomChanged(); + protected: virtual void buildButtons(); virtual void decorateMenu(QMenu *menu);