diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-05-18 22:56:19 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-05-18 22:56:19 -0500 |
commit | 197fca6d7d16fa849c6e8e214008108a26ac4c7c (patch) | |
tree | 2499a5c2a8478c873f6cb50cd9cd2a7fa2d696af | |
parent | 06c6ea9b11837d32b47dfe2807e3fc83eb80c9a4 (diff) | |
download | koopatlas-197fca6d7d16fa849c6e8e214008108a26ac4c7c.tar.gz koopatlas-197fca6d7d16fa849c6e8e214008108a26ac4c7c.zip |
Added a screensize overlay
-rw-r--r-- | src/editorui/editormain.py | 27 | ||||
-rw-r--r-- | src/ui.py | 1 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/editorui/editormain.py b/src/editorui/editormain.py index 3d2f17d..5dc8703 100644 --- a/src/editorui/editormain.py +++ b/src/editorui/editormain.py @@ -391,6 +391,32 @@ class KPEditorWidget(QtGui.QGraphicsView): self.assignNewScene(scene) + def drawForeground(self, painter, rect): + + painter.setPen(Qt.red) + painter.setBrush(Qt.transparent) + + c = rect.center() + x = c.x() + y = c.y() + + zooms = [5.0, 10.0, 25.0, 50.0, 75.0, 100.0, 150.0, 200.0, 400.0] + m = zooms[KP.mainWindow.ZoomLevel] / 100.0 + + mx = 880.0 / 2.0 * m + my = 660.0 / 2.0 * m + + m2x = 1180.0 / 2.0 * m + m2y = 660.0 / 2.0 * m + + # mx = 1792.0 / 2.0 * m + # my = 1344.0 / 2.0 * m + newRect = QtCore.QRectF(x-mx, y-my, mx*2.0, my*2.0) + painter.drawRect(newRect) + + newRect2 = QtCore.QRectF(x-m2x, y-m2y, m2x*2.0, m2y*2.0) + painter.drawRect(newRect2) + def assignNewScene(self, scene): self.setScene(scene) self.centerOn(0,0) @@ -733,6 +759,7 @@ class KPEditorWidget(QtGui.QGraphicsView): obj.setSelected(False) obj.remove(True) scene.update() + self.userClick.emit() self.update() return @@ -1111,6 +1111,7 @@ class KPMainWindow(QtGui.QMainWindow): self.scene = KPMapScene() self.editor.assignNewScene(self.scene) + self.anmPopulate() self.updateTitlebar() def updateTitlebar(self): |