index ee05cd01cd011c6591301a6eb445e693a7a39e3c..550fd35593fd97bf782f338c286cf054087392de 100644 (file)
-#define CANVAS_AXONOMGRID_C
-
/*
* Copyright (C) 2006-2008 Johan Engelen <johan@shouraizou.nl>
*/
#include "canvas-axonomgrid.h"
#include "util/mathfns.h"
#include "2geom/line.h"
-#include "display-forward.h"
#include <libnr/nr-pixops.h>
#include "canvas-grid.h"
{
ow = origin * affine;
sw = Geom::Point(fabs(affine[0]),fabs(affine[3]));
+ sw *= lengthy;
+
+ scaled = false;
for(int dim = 0; dim < 2; dim++) {
gint scaling_factor = empspacing;
if (scaling_factor <= 1)
scaling_factor = 5;
- scaled = FALSE;
int watchdog = 0;
while ( (sw[dim] < 8.0) & (watchdog < 100) ) {
- scaled = TRUE;
+ scaled = true;
sw[dim] *= scaling_factor;
// First pass, go up to the major line spacing, then
// keep increasing by two.
}
- spacing_ylines = sw[Geom::X] * lengthy /(tan_angle[X] + tan_angle[Z]);
- lyw = sw[Geom::Y] * lengthy;
- lxw_x = (lengthy / tan_angle[X]) * sw[Geom::X];
- lxw_z = (lengthy / tan_angle[Z]) * sw[Geom::X];
+ spacing_ylines = sw[Geom::X] /(tan_angle[X] + tan_angle[Z]);
+ lyw = sw[Geom::Y];
+ lxw_x = sw[Geom::X] / tan_angle[X];
+ lxw_z = sw[Geom::X] / tan_angle[Z];
if (empspacing == 0) {
- scaled = TRUE;
+ scaled = true;
}
}
@@ -792,9 +791,9 @@ void CanvasAxonomGridSnapper::_addSnappedLine(SnappedConstraints &sc, Geom::Poin
sc.grid_lines.push_back(dummy);
}
-void CanvasAxonomGridSnapper::_addSnappedPoint(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, SnapSourceType const &source, long source_num) const
+void CanvasAxonomGridSnapper::_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 :