Skip to content

Commit

Permalink
fix(src/util/clip.js): fix lib.js import part of clip error (#1085)
Browse files Browse the repository at this point in the history
  • Loading branch information
xingbofeng authored and dannyrb committed Sep 27, 2019
1 parent 6b50c98 commit 41e0f4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/util/clip.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @param {number} high The upper bound.
* @returns {number} The clipped value.
*/
export default function clip(val, low, high) {
export function clip(val, low, high) {
return Math.min(Math.max(low, val), high);
}

Expand All @@ -26,3 +26,5 @@ export function clipToBox(point, box) {
point.x = clip(point.x, 0, box.width);
point.y = clip(point.y, 0, box.height);
}

export default clip;

0 comments on commit 41e0f4f

Please sign in to comment.