summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eee76dc)
raw | patch | inline | side by side (parent: eee76dc)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 23 Oct 2006 19:13:18 +0000 (19:13 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Mon, 23 Oct 2006 19:13:18 +0000 (19:13 +0000) |
src/axonomgrid-snapper.cpp | patch | blob | history |
index 674357d44665765fb1dd31198673da08bb4cbc99..811eb4218b1150b503eb08e15b8ad3b23f001c61 100644 (file)
#include "sp-namedview.h"\r
#include "inkscape.h"\r
#include "desktop.h"\r
-#include "display/canvas-grid.h"\r
+#include "display/canvas-axonomgrid.h"\r
\r
/**\r
* \return x rounded to the nearest multiple of c1 plus c0.\r
*/\r
\r
/* FIXME: move this somewhere else, perhaps */\r
-static double round_to_nearest_multiple_plus(double x, double const c1, double const c0)\r
-{\r
- return floor((x - c0) / c1 + .5) * c1 + c0;\r
-}\r
+static \r
\r
Inkscape::AxonomGridSnapper::AxonomGridSnapper(SPNamedView const *nv, NR::Coord const d) : LineSnapper(nv, d)\r
{\r
Inkscape::LineSnapper::LineList \r
Inkscape::AxonomGridSnapper::_getSnapLines(NR::Point const &p) const\r
{\r
+ double round_to_nearest_multiple_plus(double x, double const c1, double const c0)\r
+ {\r
+ return floor((x - c0) / c1 + .5) * c1 + c0;\r
+ } \r
+ \r
LineList s;\r
\r
if ( NULL == _named_view ) {\r
return s;\r
}\r
\r
- SPCGrid *griditem = NULL;\r
+ SPCAxonomGrid *griditem = NULL;\r
for (GSList *l = _named_view->gridviews; l != NULL; l = l->next) {\r
// FIXME : this is a hack since there is only one view for now\r
// but when we'll handle multiple views, snapping should\r
// must be rethought and maybe only the current view\r
// should give back it's SHOWN lines to snap to\r
// For now, the last SPCGrid in _named_view->gridviews will be used.\r
- griditem = SP_CGRID(l->data);\r
+ griditem = SP_CAXONOMGRID(l->data);\r
}\r
\r
g_assert(griditem != NULL);\r