From ffba6ae904deaef040defebcc0ff6f7458dbb969 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 30 Oct 2010 00:07:10 +0200 Subject: - Constrained snap: proper implementation of the preference to snap the mouse pointer or handle itself (instead of projecting it first onto the constraint) - Fix a crash in SnapManager::multipleConstrainedSnaps (bzr r9866) --- src/util/mathfns.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/util') diff --git a/src/util/mathfns.h b/src/util/mathfns.h index 20c06145a..e208ca93f 100644 --- a/src/util/mathfns.h +++ b/src/util/mathfns.h @@ -48,7 +48,7 @@ inline double round_to_nearest_multiple_plus(double x, double const c1, double c * If c1==0 (and c0 is finite), then returns +/-inf. This makes grid spacing of zero * mean "ignore the grid in this dimension". */ -inline double round_to_lower_multiple_plus(double x, double const c1, double const c0) +inline double round_to_lower_multiple_plus(double x, double const c1, double const c0 = 0) { return floor((x - c0) / c1) * c1 + c0; } @@ -60,7 +60,7 @@ inline double round_to_lower_multiple_plus(double x, double const c1, double con * If c1==0 (and c0 is finite), then returns +/-inf. This makes grid spacing of zero * mean "ignore the grid in this dimension". */ -inline double round_to_upper_multiple_plus(double x, double const c1, double const c0) +inline double round_to_upper_multiple_plus(double x, double const c1, double const c0 = 0) { return ceil((x - c0) / c1) * c1 + c0; } -- cgit v1.2.3