summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-12-02 23:17:00 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-12-02 23:17:00 +0000
commitcd16f442aef640937024ac79bc5a874e7880034e (patch)
tree4e423de0788ac27ac6e22e591439f81e1ae00a16 /src
parentFix compile. Don't #include .cpp files! (diff)
downloadinkscape-cd16f442aef640937024ac79bc5a874e7880034e.tar.gz
inkscape-cd16f442aef640937024ac79bc5a874e7880034e.zip
Snapping of axonometric grid: correctly snap to vertical gridline. angled lines not implemented yet.
(bzr r4158)
Diffstat (limited to 'src')
-rw-r--r--src/display/canvas-axonomgrid.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp
index 698211b6c..cd79e00bd 100644
--- a/src/display/canvas-axonomgrid.cpp
+++ b/src/display/canvas-axonomgrid.cpp
@@ -640,23 +640,20 @@ CanvasAxonomGridSnapper::_getSnapLines(NR::Point const &p) const
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;
}