summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c61d5e)
raw | patch | inline | side by side (parent: 6c61d5e)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 2 Dec 2007 23:17:00 +0000 (23:17 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 2 Dec 2007 23:17:00 +0000 (23:17 +0000) |
src/display/canvas-axonomgrid.cpp | patch | blob | history |
index 698211b6c109e90e511b70a5829a7d601aa588eb..cd79e00bd538db52a788a378af98ec080a4065b2 100644 (file)
return s;
}
- for (unsigned int i = 0; i < 2; ++i) {
+ /* This is to make sure we snap to only visible grid lines */
+ double scaled_spacing = grid->spacing_ylines; // this is spacing of visible lines if screen pixels
- /* This is to make sure we snap to only visible grid lines */
- double scaled_spacing = grid->sw[i]; // this is spacing of visible lines if screen pixels
-
- // convert screen pixels to px
- // FIXME: after we switch to snapping dist in screen pixels, this will be unnecessary
- if (SP_ACTIVE_DESKTOP) {
- scaled_spacing /= SP_ACTIVE_DESKTOP->current_zoom();
- }
+ // convert screen pixels to px
+ // FIXME: after we switch to snapping dist in screen pixels, this will be unnecessary
+ if (SP_ACTIVE_DESKTOP) {
+ scaled_spacing /= SP_ACTIVE_DESKTOP->current_zoom();
+ }
- NR::Coord const rounded = round_to_nearest_multiple_plus(p[i],
- scaled_spacing,
- grid->origin[i]);
+ NR::Coord const rounded = round_to_nearest_multiple_plus(p[0],
+ scaled_spacing,
+ grid->origin[0]);
- s.push_back(std::make_pair(NR::Dim2(i), rounded));
- }
+ s.push_back(std::make_pair(NR::Dim2(0), rounded));
return s;
}