From 4ec6225a9273b8f0c93e4b3d93ecf1e1686b719c Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 4 Feb 2022 20:28:18 +0100 Subject: Fix errors from transition from node-sass to sass --- src/_easing.scss | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/_easing.scss') diff --git a/src/_easing.scss b/src/_easing.scss index c41635b..a39f317 100644 --- a/src/_easing.scss +++ b/src/_easing.scss @@ -9,6 +9,8 @@ /// @access public //// +@use 'sass:math'; + /// /// @access private /// @@ -75,7 +77,7 @@ $iro-cubic-bezier-subdiv-max-iters: 10 !default; $samples: (); @for $i from 0 through $iro-cubic-bezier-sample-pool-size { - $samples: append($samples, iro-cubic-bezier-func($x1, $x2, $i / $iro-cubic-bezier-sample-pool-size)); + $samples: append($samples, iro-cubic-bezier-func($x1, $x2, math.div($i, $iro-cubic-bezier-sample-pool-size))); } $iro-cubic-bezier-sample-pool: map-merge($iro-cubic-bezier-sample-pool, ($sample-pool-key: $samples)) !global; @@ -141,7 +143,7 @@ $iro-cubic-bezier-subdiv-max-iters: 10 !default; } $cur-x: iro-cubic-bezier-func($x1, $x2, $t) - $x; - $t: $t - $cur-x / $cur-slope; + $t: $t - math.div($cur-x, $cur-slope); } @return $t; @@ -189,13 +191,13 @@ $iro-cubic-bezier-subdiv-max-iters: 10 !default; $last-sample: $iro-cubic-bezier-sample-pool-size; @while ($cur-sample != $last-sample) and (nth($samples, $cur-sample) <= $x) { - $intv-start: $intv-start + (1 / $iro-cubic-bezier-sample-pool-size); + $intv-start: $intv-start + math.div(1, $iro-cubic-bezier-sample-pool-size); $cur-sample: $cur-sample + 1; } $cur-sample: $cur-sample - 1; - $dist: ($x - nth($samples, $cur-sample)) / (nth($samples, $cur-sample + 1) - nth($samples, $cur-sample)); - $guess-t: $intv-start + $dist / $iro-cubic-bezier-sample-pool-size; + $dist: math.div($x - nth($samples, $cur-sample), nth($samples, $cur-sample + 1) - nth($samples, $cur-sample)); + $guess-t: $intv-start + math.div($dist, $iro-cubic-bezier-sample-pool-size); $init-slope: iro-cubic-bezier-func-slope($x1, $x2, $guess-t); @if $init-slope >= $iro-cubic-bezier-newton-min-slope { -- cgit v1.3.1