diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-04-01 22:32:34 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-04-01 22:32:34 +0000 |
| commit | f98df6e3074639847b1528609c91123bf03e44d1 (patch) | |
| tree | bf877622a0faa47157c9544b4d405c72e8e8eb79 /src/display/canvas-grid.cpp | |
| parent | discard stderr from nested inkscape invocations (diff) | |
| download | inkscape-f98df6e3074639847b1528609c91123bf03e44d1.tar.gz inkscape-f98df6e3074639847b1528609c91123bf03e44d1.zip | |
removed leftover debug messages. Toggling new grids now works. Almost ready to comment-out old grid code.
(bzr r2806)
Diffstat (limited to 'src/display/canvas-grid.cpp')
| -rw-r--r-- | src/display/canvas-grid.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 643ffccdc..f343077c3 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -143,7 +143,7 @@ CanvasGrid::CanvasGrid(SPDesktop *desktop, Inkscape::XML::Node * in_repr) gtk_object_ref(GTK_OBJECT(canvasitem)); // since we're keeping a copy, we need to bump up the ref count canvasitem->grid = this; - enabled = false; + snapenabled = false; visible = false; // sp_canvas_item_hide(canvasitem); @@ -166,7 +166,6 @@ CanvasGrid::~CanvasGrid() // deref canvasitem gtk_object_unref(GTK_OBJECT(canvasitem)); g_free(canvasitem); - g_message("~CanvasGrid"); } /* @@ -217,6 +216,7 @@ CanvasGrid::hide() { sp_canvas_item_hide(canvasitem); visible = false; + disable_snapping(); // temporary hack, because at the moment visibilty and snapping are linked } void @@ -224,6 +224,25 @@ CanvasGrid::show() { sp_canvas_item_show(canvasitem); visible = true; + enable_snapping(); // temporary hack, because at the moment visibilty and snapping are linked +} + +void +CanvasGrid::set_visibility(bool visible) +{ + this->visible = visible; + if(visible) { + show(); + } else { + hide(); + } +} + +void +CanvasGrid::toggle_visibility() +{ + visible = !visible; + set_visibility(visible); } void |
