on zlevel changed the frame operation mode is reset to resize instead of scale

preferencesAboutTextFull
-f 11 years ago
parent 5cf4320707
commit dabaca53ae
  1. 6
      src/domain/UBGraphicsDelegateFrame.cpp
  2. 1
      src/domain/UBGraphicsItemTransformUndoCommand.h
  3. 4
      src/domain/UBGraphicsScene.cpp
  4. 5
      src/domain/UBGraphicsTextItemDelegate.cpp

@ -401,7 +401,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
qreal width = delegated()->boundingRect().width() * mTotalScaleX; qreal width = delegated()->boundingRect().width() * mTotalScaleX;
qreal height = delegated()->boundingRect().height() * mTotalScaleY; qreal height = delegated()->boundingRect().height() * mTotalScaleY;
if (mOperationMode == Scaling) if (mOperationMode == Scaling)
{ {
if(!rotating()) if(!rotating())
{ {
@ -443,8 +443,8 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
mScaleY = scaleY; mScaleY = scaleY;
} }
} }
}else if (resizingLeft() || resizingRight()) }
{ else if (resizingLeft() || resizingRight()){
if(width != 0){ if(width != 0){
qreal scaleX = 0.0; qreal scaleX = 0.0;
if(resizingLeft()){ if(resizingLeft()){

@ -30,7 +30,6 @@
#include <QtGui> #include <QtGui>
#include "UBResizableGraphicsItem.h"
#include "UBUndoCommand.h" #include "UBUndoCommand.h"

@ -257,9 +257,7 @@ qreal UBZLayerController::changeZLevelTo(QGraphicsItem *item, moveDestination de
foreach (QGraphicsItem *iitem, sortedItems.values()) { foreach (QGraphicsItem *iitem, sortedItems.values()) {
if (iitem) if (iitem)
iitem != item iitem != item ? qDebug() << "current value" << iitem->zValue() : qDebug() << "marked value" << QString::number(iitem->zValue(), 'f');
? qDebug() << "current value" << iitem->zValue()
: qDebug() << "marked value" << QString::number(iitem->zValue(), 'f');
} }
//Return new z value assigned to item //Return new z value assigned to item

@ -195,6 +195,11 @@ void UBGraphicsTextItemDelegate::createControls()
button->setFlag(QGraphicsItem::ItemIsSelectable, true); button->setFlag(QGraphicsItem::ItemIsSelectable, true);
} }
// Claudio: on changing the zvlaue the frame is updated updateSelectionFrame and
// the default value for the operation mode is set (scaling). This isn't the right
// mode for text so we call that here.
frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);
} }

Loading…
Cancel
Save