index 3532c504a73954f30666174de8e3c0f033774f9c..df73eb78e0496470ec00255661e57c5d0ca4ff14 100644 (file)
*/
/* Copyright (C) Johan Engelen 2006-2007 <johan@shouraizou.nl>
* Copyright (C) Lauris Kaplinski 2000
+ * Abhishek Sharma
*/
/* As a general comment, I am not exactly proud of how things are done.
* Don't be shy to correct things.
*/
-#define INKSCAPE_CANVAS_GRID_C
-
#include "sp-canvas-util.h"
#include "util/mathfns.h"
#include "display-forward.h"
#include "canvas-grid.h"
#include "canvas-axonomgrid.h"
+using Inkscape::DocumentUndo;
+
namespace Inkscape {
static gchar const *const grid_name[] = {
@@ -247,7 +248,7 @@ CanvasGrid::writeNewGridToRepr(Inkscape::XML::Node * repr, SPDocument * doc, Gri
// first create the child xml node, then hook it to repr. This order is important, to not set off listeners to repr before the new node is complete.
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
+ Inkscape::XML::Document *xml_doc = doc->getReprDoc();
Inkscape::XML::Node *newnode;
newnode = xml_doc->createElement("inkscape:grid");
newnode->setAttribute("type", getSVGName(gridtype));
@@ -255,7 +256,7 @@ CanvasGrid::writeNewGridToRepr(Inkscape::XML::Node * repr, SPDocument * doc, Gri
repr->appendChild(newnode);
Inkscape::GC::release(newnode);
- sp_document_done(doc, SP_VERB_DIALOG_NAMEDVIEW, _("Create new grid"));
+ DocumentUndo::done(doc, SP_VERB_DIALOG_NAMEDVIEW, _("Create new grid"));
}
/*
@@ -1030,9 +1031,9 @@ void CanvasXYGridSnapper::_addSnappedLine(SnappedConstraints &sc, Geom::Point co
sc.grid_lines.push_back(dummy);
}
-void CanvasXYGridSnapper::_addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num) const
+void CanvasXYGridSnapper::_addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num, bool constrained_snap) const
{
- SnappedPoint dummy = SnappedPoint(snapped_point, source, source_num, Inkscape::SNAPTARGET_GRID, snapped_distance, getSnapperTolerance(), getSnapperAlwaysSnap(), true);
+ SnappedPoint dummy = SnappedPoint(snapped_point, source, source_num, Inkscape::SNAPTARGET_GRID, snapped_distance, getSnapperTolerance(), getSnapperAlwaysSnap(), constrained_snap, true);
sc.points.push_back(dummy);
}
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :