From 4cc63b00182b8f4b23705a6da086b601a2b5a646 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Mon, 23 Oct 2006 19:13:18 +0000 Subject: [PATCH] axonomgrid: Bugfix --- src/axonomgrid-snapper.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/axonomgrid-snapper.cpp b/src/axonomgrid-snapper.cpp index 674357d44..811eb4218 100644 --- a/src/axonomgrid-snapper.cpp +++ b/src/axonomgrid-snapper.cpp @@ -15,7 +15,7 @@ #include "sp-namedview.h" #include "inkscape.h" #include "desktop.h" -#include "display/canvas-grid.h" +#include "display/canvas-axonomgrid.h" /** * \return x rounded to the nearest multiple of c1 plus c0. @@ -27,10 +27,7 @@ */ /* FIXME: move this somewhere else, perhaps */ -static double round_to_nearest_multiple_plus(double x, double const c1, double const c0) -{ - return floor((x - c0) / c1 + .5) * c1 + c0; -} +static Inkscape::AxonomGridSnapper::AxonomGridSnapper(SPNamedView const *nv, NR::Coord const d) : LineSnapper(nv, d) { @@ -40,20 +37,25 @@ Inkscape::AxonomGridSnapper::AxonomGridSnapper(SPNamedView const *nv, NR::Coord Inkscape::LineSnapper::LineList Inkscape::AxonomGridSnapper::_getSnapLines(NR::Point const &p) const { + double round_to_nearest_multiple_plus(double x, double const c1, double const c0) + { + return floor((x - c0) / c1 + .5) * c1 + c0; + } + LineList s; if ( NULL == _named_view ) { return s; } - SPCGrid *griditem = NULL; + SPCAxonomGrid *griditem = NULL; for (GSList *l = _named_view->gridviews; l != NULL; l = l->next) { // FIXME : this is a hack since there is only one view for now // but when we'll handle multiple views, snapping should // must be rethought and maybe only the current view // should give back it's SHOWN lines to snap to // For now, the last SPCGrid in _named_view->gridviews will be used. - griditem = SP_CGRID(l->data); + griditem = SP_CAXONOMGRID(l->data); } g_assert(griditem != NULL); -- 2.30.2