Locked media items is not movable now.

Locked items cannot be moved horizontally by its frame.

Text items can be resized correctly now.
preferencesAboutTextFull
Aleksei Kanash 13 years ago
parent 307c456681
commit e79ed88589
  1. 6
      src/domain/UBGraphicsDelegateFrame.cpp
  2. 11
      src/domain/UBGraphicsMediaItem.cpp

@ -249,6 +249,9 @@ bool UBGraphicsDelegateFrame::canResizeBottomRight(qreal width, qreal height, qr
void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
if (mDelegate->delegated()->data(UBGraphicsItemData::ItemLocked).toBool())
return;
QLineF move(mStartingPoint, event->scenePos()); QLineF move(mStartingPoint, event->scenePos());
qreal moveX = move.length() * cos((move.angle() - mAngle) * PI / 180); qreal moveX = move.length() * cos((move.angle() - mAngle) * PI / 180);
qreal moveY = -move.length() * sin((move.angle() - mAngle) * PI / 180); qreal moveY = -move.length() * sin((move.angle() - mAngle) * PI / 180);
@ -390,9 +393,6 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QSizeF newSize = resizableItem->size() + incVector; QSizeF newSize = resizableItem->size() + incVector;
if (!(mDelegate->getToolBarItem()->isVisibleOnBoard()
&& (newSize.width() < mDelegate->getToolBarItem()->minWidth() / mDelegate->antiScaleRatio()
|| newSize.height() < mDelegate->getToolBarItem()->minWidth() / mDelegate->antiScaleRatio() * 3/4)))
resizableItem->resize(newSize); resizableItem->resize(newSize);
} }
} }

@ -223,14 +223,6 @@ UBItem* UBGraphicsMediaItem::deepCopy() const
void UBGraphicsMediaItem::mousePressEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsMediaItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
// QDrag* mDrag = new QDrag(event->widget());
// QMimeData* pMime = new QMimeData();
// mDrag->setMimeData(pMime);
// mDrag->start();
// UBApplication::boardController->activeScene()->setActiveItem(this);
if (mDelegate) if (mDelegate)
{ {
mDelegate->mousePressEvent(event); mDelegate->mousePressEvent(event);
@ -279,6 +271,9 @@ void UBGraphicsMediaItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
void UBGraphicsMediaItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsMediaItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
if (data(UBGraphicsItemData::ItemLocked).toBool())
return;
if(mShouldMove && (event->buttons() & Qt::LeftButton)) if(mShouldMove && (event->buttons() & Qt::LeftButton))
{ {
QPointF offset = event->scenePos() - mMousePressPos; QPointF offset = event->scenePos() - mMousePressPos;

Loading…
Cancel
Save