summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-12-27 02:25:02 +0100
committerneoraider <devnull@localhost>2007-12-27 02:25:02 +0100
commit017743d3397b810176278814ed19a92ce9c2f251 (patch)
treeae937ff2cba4dc0c145162681297cdcab377a3d7
parent052641637bd20ffde6ddb8919888e2af987bafff (diff)
downloadzoomedit-017743d3397b810176278814ed19a92ce9c2f251.tar
zoomedit-017743d3397b810176278814ed19a92ce9c2f251.zip
zoomedit: Fixed some ToolAddRect bugs.
-rw-r--r--ToolAddRect.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/ToolAddRect.cpp b/ToolAddRect.cpp
index a266756..6551be6 100644
--- a/ToolAddRect.cpp
+++ b/ToolAddRect.cpp
@@ -17,6 +17,8 @@ Room ToolAddRect::createRoom() {
ToolAddRect::ToolAddRect(EditManager *editManager) : Renderer(editManager), sidebar(editManager) {
this->editManager = editManager;
+ pressed = false;
+
image = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_BUTTON);
g_object_ref_sink(G_OBJECT(image));
}
@@ -72,18 +74,21 @@ bool ToolAddRect::buttonRelease(unsigned int button) {
pressed = false;
- if(!editManager->getHoveredVertex())
- return false;
-
- Room room = createRoom();
-
- if(!editManager->polygonOk(room))
- return false;
-
- editManager->addRoom(room);
+ if(editManager->getHoveredVertex()) {
+ Room room = createRoom();
+
+ if(editManager->polygonOk(room)) {
+ editManager->addRoom(room);
+
+ editManager->redraw();
+ sidebar.update();
+
+ return true;
+ }
+ }
editManager->redraw();
sidebar.update();
- return true;
+ return false;
}