diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-06-05 01:04:35 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-06-05 01:04:35 -0400 |
commit | 4e397e5a576a312d6365a4c1da9a3ee8096623fa (patch) | |
tree | 3e1f5841af8dfd683fd5db88a14bfd12db56ed50 | |
parent | f184c1d8d4410f735287c4663494ce4af4f6826b (diff) | |
download | sigen-4e397e5a576a312d6365a4c1da9a3ee8096623fa.tar.gz sigen-4e397e5a576a312d6365a4c1da9a3ee8096623fa.tar.xz sigen-4e397e5a576a312d6365a4c1da9a3ee8096623fa.zip |
Disable WorldMapPlacement usage
-rw-r--r-- | sigmodr/widgets/mapeditor/WorldMapItem.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/sigmodr/widgets/mapeditor/WorldMapItem.cpp b/sigmodr/widgets/mapeditor/WorldMapItem.cpp index 6dceaed3..7e82414e 100644 --- a/sigmodr/widgets/mapeditor/WorldMapItem.cpp +++ b/sigmodr/widgets/mapeditor/WorldMapItem.cpp @@ -124,23 +124,23 @@ void WorldMapItem::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) void WorldMapItem::mouseMoveEvent(QGraphicsSceneMouseEvent* event) { - QList<QGraphicsItem*> items = scene()->items(); - QList<QGraphicsItem*> cItems = scene()->items(QRectF(event->scenePos() - event->buttonDownPos(Qt::LeftButton), QSizeF(m_map->width(), m_map->height()))); - QtConcurrent::blockingFilter(items, isSetWorldMapItem); - QtConcurrent::blockingFilter(cItems, isSetWorldMapItem); - items.removeAll(this); - cItems.removeAll(this); - if (cItems.size()) - { - WorldMapPlacement placement(QSize(m_map->width(), m_map->height())); - foreach (QGraphicsItem* item, items) - { - WorldMapItem* mapItem = qgraphicsitem_cast<WorldMapItem*>(item); - placement.addRect(QRectF(item->scenePos(), QSizeF(mapItem->m_map->width(), mapItem->m_map->height()))); - } - setPos(placement.find(((QPointF(m_map->width(), m_map->height()) / 2.) + event->scenePos() - event->buttonDownPos(Qt::LeftButton)).toPoint())); - } - else +// QList<QGraphicsItem*> items = scene()->items(); +// QList<QGraphicsItem*> cItems = scene()->items(QRectF(event->scenePos() - event->buttonDownPos(Qt::LeftButton), QSizeF(m_map->width(), m_map->height()))); +// QtConcurrent::blockingFilter(items, isSetWorldMapItem); +// QtConcurrent::blockingFilter(cItems, isSetWorldMapItem); +// items.removeAll(this); +// cItems.removeAll(this); +// if (cItems.size()) +// { +// WorldMapPlacement placement(QSize(m_map->width(), m_map->height())); +// foreach (QGraphicsItem* item, items) +// { +// WorldMapItem* mapItem = qgraphicsitem_cast<WorldMapItem*>(item); +// placement.addRect(QRectF(item->scenePos(), QSizeF(mapItem->m_map->width(), mapItem->m_map->height()))); +// } +// setPos(placement.find(((QPointF(m_map->width(), m_map->height()) / 2.) + event->scenePos() - event->buttonDownPos(Qt::LeftButton)).toPoint())); +// } +// else setPos(event->scenePos() - event->buttonDownPos(Qt::LeftButton)); event->accept(); moveTo(scenePos().toPoint()); @@ -151,6 +151,7 @@ void WorldMapItem::keyPressEvent(QKeyEvent* event) { if (event->key() == Qt::Key_Space) { + // FIXME: Map placement is broken QList<QGraphicsItem*> items; if (!m_locked) { @@ -171,7 +172,7 @@ void WorldMapItem::keyPressEvent(QKeyEvent* event) m_locked = !m_locked; setFlag(ItemIsMovable, !m_locked); update(); - WorldMapPlacement::invalidateCache(); +// WorldMapPlacement::invalidateCache(); return; } } |