Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Offsetting translation with the pixel multiplier
- Loading branch information
Showing
with
3 additions
and
2 deletions.
-
+3
−2
framer/SVGBaseLayer.coffee
|
@@ -89,13 +89,14 @@ class exports.SVGBaseLayer extends Layer |
|
|
options.y ?= 0 |
|
|
options.rotation ?= 0 |
|
|
indicesToRemove = [] |
|
|
pixelMultiplier = Framer?.CurrentContext.pixelMultiplier ? 1 |
|
|
for i in [0...@_element.transform.baseVal.numberOfItems] |
|
|
transform = @_element.transform.baseVal.getItem(i) |
|
|
matrix = transform.matrix |
|
|
switch transform.type |
|
|
when 2 #SVG_TRANSFORM_TRANSLATE |
|
|
options.x += matrix.e |
|
|
options.y += matrix.f |
|
|
options.x += matrix.e / pixelMultiplier |
|
|
options.y += matrix.f / pixelMultiplier |
|
|
indicesToRemove.push(i) |
|
|
when 4 #SVG_TRANSFORM_ROTATE |
|
|
# We willingly ignore the translation from this matrix |
|
|