summaryrefslogtreecommitdiffstats
path: root/src/display/canvas-grid.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-04-01 22:32:34 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-04-01 22:32:34 +0000
commitf98df6e3074639847b1528609c91123bf03e44d1 (patch)
treebf877622a0faa47157c9544b4d405c72e8e8eb79 /src/display/canvas-grid.cpp
parentdiscard stderr from nested inkscape invocations (diff)
downloadinkscape-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.cpp23
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