Fix positioning a transformation origin for a background image.
This commit is contained in:
parent
3e64af6443
commit
6e924ba0fa
|
@ -178,7 +178,10 @@ void VBackgroundImageControls::UpdateControls()
|
||||||
|
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
m_image = m_doc->GetBackgroundImage(m_id);
|
m_image = m_doc->GetBackgroundImage(m_id);
|
||||||
m_originPos = m_image.BoundingRect().center();
|
if(not m_customOrigin)
|
||||||
|
{
|
||||||
|
m_originPos = m_image.BoundingRect().center();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -394,6 +397,8 @@ void VBackgroundImageControls::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VBackgroundImageControls::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
void VBackgroundImageControls::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
m_customOrigin = true;
|
||||||
|
|
||||||
if (m_tranformationType == BITransformationType::Scale)
|
if (m_tranformationType == BITransformationType::Scale)
|
||||||
{
|
{
|
||||||
ScaleImage(event);
|
ScaleImage(event);
|
||||||
|
@ -426,8 +431,10 @@ void VBackgroundImageControls::mouseReleaseEvent(QGraphicsSceneMouseEvent *event
|
||||||
setCursor(VAbstractValApplication::VApp()->getSceneView()->viewport()->cursor());
|
setCursor(VAbstractValApplication::VApp()->getSceneView()->viewport()->cursor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_customOrigin = false;
|
||||||
m_controlsVisible = true;
|
m_controlsVisible = true;
|
||||||
m_allowChangeMerge = false;
|
m_allowChangeMerge = false;
|
||||||
|
m_originSaved = false;
|
||||||
|
|
||||||
if (m_tranformationType == BITransformationType::Scale)
|
if (m_tranformationType == BITransformationType::Scale)
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,6 +131,8 @@ private:
|
||||||
|
|
||||||
bool m_showOrigin{false};
|
bool m_showOrigin{false};
|
||||||
QPointF m_originPos{};
|
QPointF m_originPos{};
|
||||||
|
bool m_originSaved{false};
|
||||||
|
bool m_customOrigin{false};
|
||||||
|
|
||||||
void InitPixmaps();
|
void InitPixmaps();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user