Commit d6295358 authored by Craig Watson's avatar Craig Watson

Fix text box title bar height/spacing when zooming

parent 0491ce9e
......@@ -66,6 +66,7 @@ UBGraphicsDelegateFrame::UBGraphicsDelegateFrame(UBGraphicsItemDelegate* pDelega
, mMirrorX(false)
, mMirrorY(false)
, mTitleBarHeight(hasTitleBar ? 20 :0)
, mNominalTitleBarHeight(hasTitleBar ? 20:0)
{
mAngleTolerance = UBSettings::settings()->angleTolerance->get().toReal();
......@@ -117,6 +118,7 @@ UBGraphicsDelegateFrame::~UBGraphicsDelegateFrame()
void UBGraphicsDelegateFrame::setAntiScale(qreal pAntiScale)
{
mFrameWidth = mNominalFrameWidth * pAntiScale;
mTitleBarHeight = mNominalTitleBarHeight * pAntiScale;
QTransform tr;
tr.scale(pAntiScale, pAntiScale);
......
......@@ -143,6 +143,7 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
bool mMirroredXAtStart;
bool mMirroredYAtStart;
qreal mTitleBarHeight;
qreal mNominalTitleBarHeight;
QList<UBGraphicsDelegateFrame *> mLinkedFrames;
};
......
......@@ -790,7 +790,7 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
}
else if (button->getSection() == Qt::TitleBarArea){
button->setParentItem(mFrame);
button->setPos(topXTitleBar + (k++ * (frameButtonHeight + 5)), topYTitleBar);
button->setPos(topXTitleBar + (k++ * (frameButtonHeight + 5) * mAntiScaleRatio), topYTitleBar);
button->setTransform(tr);
button->setTransform(QTransform::fromScale(0.8, 0.8), true);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment