summaryrefslogtreecommitdiffstats
path: root/src/helpers.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-10-17 23:09:34 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-10-17 23:09:34 +0200
commit417d4b253d2daea0ef3c437c5b3d5eda6ccc7525 (patch)
tree1b5e6528df2cd679af07e4ffc44c177ed35dac68 /src/helpers.js
parent8db39b099ea85d881f5e4d12b2b2182d41414da4 (diff)
downloadsvg.js-417d4b253d2daea0ef3c437c5b3d5eda6ccc7525.tar.gz
svg.js-417d4b253d2daea0ef3c437c5b3d5eda6ccc7525.zip
add babel, satisfy linter, build dist
Diffstat (limited to 'src/helpers.js')
-rw-r--r--src/helpers.js16
1 files changed, 2 insertions, 14 deletions
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 ]
}