diff --git a/src/domain/UBGraphicsDelegateFrame.cpp b/src/domain/UBGraphicsDelegateFrame.cpp index 027d35da..91a9d353 100644 --- a/src/domain/UBGraphicsDelegateFrame.cpp +++ b/src/domain/UBGraphicsDelegateFrame.cpp @@ -583,9 +583,9 @@ void UBGraphicsDelegateFrame::positionHandles() { QRectF itemRect = delegated()->boundingRect(); -// if (mDelegate->getToolBarItem()->isVisibleOnBoard() -// && mDelegate->getToolBarItem()->isShifting()) -// itemRect.setHeight(itemRect.height() + mDelegate->getToolBarItem()->rect().height() * mDelegate->antiScaleRatio() * 1.1); + if (mDelegate->getToolBarItem()->isVisibleOnBoard() + && mDelegate->getToolBarItem()->isShifting()) + itemRect.setHeight(itemRect.height() + mDelegate->getToolBarItem()->rect().height() * mDelegate->antiScaleRatio() * 1.1); QTransform itemTransform = delegated()->sceneTransform(); QPointF topLeft = itemTransform.map(itemRect.topLeft()); diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index f167e9d9..35fc5bf6 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -118,7 +118,7 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec void UBGraphicsItemDelegate::init() { - //mToolBarItem = new UBGraphicsToolBarItem(delegated()); + mToolBarItem = new UBGraphicsToolBarItem(delegated()); mFrame = new UBGraphicsDelegateFrame(this, QRectF(0, 0, 0, 0), mFrameWidth, mRespectRatio); mFrame->hide(); @@ -333,17 +333,17 @@ void UBGraphicsItemDelegate::positionHandles() updateButtons(true); -// if (mToolBarItem->isVisibleOnBoard()) -// { -// updateToolBar(); -// mToolBarItem->show(); -// } + if (mToolBarItem->isVisibleOnBoard()) + { + updateToolBar(); + mToolBarItem->show(); + } } else { foreach(DelegateButton* button, mButtons) button->hide(); mFrame->hide(); -// mToolBarItem->hide(); + mToolBarItem->hide(); } } @@ -383,7 +383,7 @@ void UBGraphicsItemDelegate::remove(bool canUndo) scene->removeItem(mFrame); scene->removeItem(mDelegated); - //scene->removeItem(mToolBarItem); + scene->removeItem(mToolBarItem); if (canUndo) {