X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdrawingview.cpp;h=95721178a70be35ee56600f4a492390b8f1ed44c;hb=64482766268cddae393da1277987de31e69ffdd9;hp=bdc3540b0442fc51b243e6096da6a94b362d2632;hpb=e8987f4028a1f9c0eeb33a45bd11b2e409b9c2c5;p=architektonas diff --git a/src/drawingview.cpp b/src/drawingview.cpp index bdc3540..9572117 100644 --- a/src/drawingview.cpp +++ b/src/drawingview.cpp @@ -393,7 +393,12 @@ Now we do... :-/ update(); // Do an update if collided with at least *one* object in the document if (toolAction) + { + if (Object::snapToGrid) + point = Object::SnapPointToGrid(point); + toolAction->MouseDown(point); + } // Didn't hit any object and not using a tool, so do a selection rectangle if (!(collided || toolAction)) @@ -491,3 +496,27 @@ void DrawingView::mouseReleaseEvent(QMouseEvent * event) } } + +void DrawingView::keyPressEvent(QKeyEvent * event) +{ + if (toolAction) + { + bool needUpdate = toolAction->KeyDown(event->key()); + + if (needUpdate) + update(); + } +} + + +void DrawingView::keyReleaseEvent(QKeyEvent * event) +{ + if (toolAction) + { + bool needUpdate = toolAction->KeyReleased(event->key()); + + if (needUpdate) + update(); + } +} +