summaryrefslogtreecommitdiffstats
path: root/src/util/mathfns.h
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2010-10-29 22:07:10 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2010-10-29 22:07:10 +0000
commitffba6ae904deaef040defebcc0ff6f7458dbb969 (patch)
tree7b22f9c718ce74714a0398e1b70acfaba5ad6f4e /src/util/mathfns.h
parentDropped not working accelator key (r9858 Bug #170765) (diff)
downloadinkscape-ffba6ae904deaef040defebcc0ff6f7458dbb969.tar.gz
inkscape-ffba6ae904deaef040defebcc0ff6f7458dbb969.zip
- 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)
Diffstat (limited to 'src/util/mathfns.h')
-rw-r--r--src/util/mathfns.h4
1 files changed, 2 insertions, 2 deletions
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;
}