summaryrefslogtreecommitdiff
path: root/include/basegfx/numeric/ftools.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'include/basegfx/numeric/ftools.hxx')
-rw-r--r--include/basegfx/numeric/ftools.hxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx
index 52909c9cd75b..1ade3bb3a3d6 100644
--- a/include/basegfx/numeric/ftools.hxx
+++ b/include/basegfx/numeric/ftools.hxx
@@ -153,6 +153,25 @@ namespace basegfx
*/
BASEGFX_DLLPUBLIC double snapToNearestMultiple(double v, const double fStep);
+ /** Snap v to the range [0.0 .. fWidth] using modulo
+ */
+ double snapToZeroRange(double v, double fWidth);
+
+ /** Snap v to the range [fLow .. fHigh] using modulo
+ */
+ double snapToRange(double v, double fLow, double fHigh);
+
+ /** return fValue with the sign of fSignCarrier, thus evtl. changed
+ */
+ inline double copySign(double fValue, double fSignCarrier)
+ {
+#ifdef WNT
+ return _copysign(fValue, fSignCarrier);
+#else
+ return copysign(fValue, fSignCarrier);
+#endif
+ }
+
/** RotateFlyFrame3: Normalize to range defined by [0.0 ... fRange[, independent
if v is positive or negative.