X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fdrawingview.cpp;h=656545b945c3738442e47513b96878f2843fe2f1;hb=dbfab6256efe6b03e9750e33081d9dcdcdfc1c34;hp=89c63ed429d9a95f71aa245160d09d95c6ca7e4b;hpb=921bf050ffe5fc81a9ab377e634180e659ee5d5d;p=architektonas diff --git a/src/drawingview.cpp b/src/drawingview.cpp index 89c63ed..656545b 100644 --- a/src/drawingview.cpp +++ b/src/drawingview.cpp @@ -41,6 +41,9 @@ #define BACKGROUND_MAX_SIZE 512 +// Class variable +//Container DrawingView::document(Vector(0, 0)); + DrawingView::DrawingView(QWidget * parent/*= NULL*/): QWidget(parent), // The value in the settings file will override this. @@ -138,6 +141,7 @@ void DrawingView::SetToolActive(Action * action) toolAction = action; connect(toolAction, SIGNAL(ObjectReady(Object *)), this, SLOT(AddNewObjectToDocument(Object *))); + connect(toolAction, SIGNAL(NeedRefresh()), this, SLOT(HandleActionUpdate())); } } @@ -260,6 +264,12 @@ void DrawingView::AddNewObjectToDocument(Object * object) } +void DrawingView::HandleActionUpdate(void) +{ + update(); +} + + void DrawingView::SetCurrentLayer(int layer) { Object::currentLayer = layer; @@ -461,10 +471,10 @@ void DrawingView::keyPressEvent(QKeyEvent * event) { if (toolAction) { - bool needUpdate = toolAction->KeyDown(event->key()); + /*bool needUpdate =*/ toolAction->KeyDown(event->key()); - if (needUpdate) - update(); +// if (needUpdate) +// update(); } } @@ -473,10 +483,10 @@ void DrawingView::keyReleaseEvent(QKeyEvent * event) { if (toolAction) { - bool needUpdate = toolAction->KeyReleased(event->key()); + /*bool needUpdate =*/ toolAction->KeyReleased(event->key()); - if (needUpdate) - update(); +// if (needUpdate) +// update(); } }