From 417d4b253d2daea0ef3c437c5b3d5eda6ccc7525 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 17 Oct 2018 23:09:34 +0200 Subject: add babel, satisfy linter, build dist --- src/helpers.js | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/helpers.js') diff --git a/src/helpers.js b/src/helpers.js index fc22e4c..c2073cf 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -254,12 +254,10 @@ function formatTransforms (o) { // Populate all of the values return { - scaleX, scaleY, skewX, skewY, shear, theta, - rx, ry, tx, ty, ox, oy, px, py + scaleX, scaleY, skewX, skewY, shear, theta, rx, ry, tx, ty, ox, oy, px, py } } - // left matrix, right matrix, target matrix which is overwritten function matrixMultiply (l, r, o) { // Work out the product directly @@ -281,15 +279,13 @@ function matrixMultiply (l, r, o) { return o } - -function getOrigin (o, element, inSpace) { +function getOrigin (o, element) { // Allow origin or around as the names let origin = o.origin // o.around == null ? o.origin : o.around let ox, oy // Allow the user to pass a string to rotate around a given point if (typeof origin === 'string' || origin == null) { - // Get the bounding box of the element with no transformations applied const string = (origin || 'center').toLowerCase().trim() const { height, width, x, y } = element.bbox() @@ -305,19 +301,11 @@ function getOrigin (o, element, inSpace) { // Set the bounds eg : "bottom-left", "Top right", "middle" etc... ox = o.ox != null ? o.ox : bx oy = o.oy != null ? o.oy : by - } else { ox = origin[0] oy = origin[1] } - // Transform the origin into the current reference frame - if ( inSpace ) { - let originRelative = new SVG.Point( ox, oy ).transform(inSpace) - ox = originRelative.x - oy = originRelative.y - } - // Return the origin as it is if it wasn't a string return [ ox, oy ] } -- cgit v1.2.3