Changed: #1302 Fixed undo/redo bug (moving primitives).

--HG--
branch : gsoc2011-worldeditorqt
hg/feature/sse2
dnk-88 13 years ago
parent 34b1f12bb8
commit d6731657c1

@ -96,6 +96,7 @@ bool PixmapDatabase::loadPixmaps(const QString &zonePath, NLLIGO::CZoneBank &zon
painter.end(); painter.end();
delete pixmap; delete pixmap;
m_pixmapMap.insert(zonePixmapName, emptyPixmap); m_pixmapMap.insert(zonePixmapName, emptyPixmap);
nlwarning(QString("not found " + zonePath + zonePixmapName + ".png").toStdString().c_str());
} }
// All pixmaps must be have same size // All pixmaps must be have same size
else if (pixmap->width() != sizeX * m_textureSize) else if (pixmap->width() != sizeX * m_textureSize)

@ -150,7 +150,7 @@ void PropertyEditorWidget::updateSelection(Node *node)
prop = addConstStringArrayProperty(ligoProperty, parameter, primitive); prop = addConstStringArrayProperty(ligoProperty, parameter, primitive);
else else
// hmn? // hmn?
prop = addBoolProperty(parameter, primitive); prop = addBoolProperty(ligoProperty, parameter, primitive);
// Default value ? // Default value ?
if ((ligoProperty == NULL) || (ligoProperty->Default)) if ((ligoProperty == NULL) || (ligoProperty->Default))

@ -227,6 +227,7 @@ void WorldEditorScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
} }
m_editedSelectedItems = false; m_editedSelectedItems = false;
m_offset = QPointF(0, 0);
m_angle = 0; m_angle = 0;
m_scaleFactor = QPointF(1.0, 1.0); m_scaleFactor = QPointF(1.0, 1.0);
@ -516,7 +517,8 @@ void WorldEditorScene::checkUndoPointsMode()
void WorldEditorScene::updateWorldItemsMove(QGraphicsSceneMouseEvent *mouseEvent) void WorldEditorScene::updateWorldItemsMove(QGraphicsSceneMouseEvent *mouseEvent)
{ {
QPointF offset(mouseEvent->scenePos() - mouseEvent->lastScenePos()); QPointF offset = mouseEvent->scenePos() - mouseEvent->lastScenePos();
m_offset += offset;
if (m_pointsMode) if (m_pointsMode)
Q_FOREACH(QGraphicsItem *item, m_selectedPoints) Q_FOREACH(QGraphicsItem *item, m_selectedPoints)
{ {

Loading…
Cancel
Save