mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-31 12:03:58 -05:00
removed rotations
This commit is contained in:
parent
9df47e496f
commit
7f87c1e199
1 changed files with 0 additions and 27 deletions
|
@ -4,7 +4,6 @@ import {
|
||||||
transformSceneNode
|
transformSceneNode
|
||||||
} from '@plugin/transformers/partials';
|
} from '@plugin/transformers/partials';
|
||||||
import { translateFills } from '@plugin/translators';
|
import { translateFills } from '@plugin/translators';
|
||||||
import { matrixInvert } from '@plugin/utils/matrixInvert';
|
|
||||||
|
|
||||||
import { RectShape } from '@ui/lib/types/rect/rectShape';
|
import { RectShape } from '@ui/lib/types/rect/rectShape';
|
||||||
|
|
||||||
|
@ -13,36 +12,10 @@ export const transformRectangleNode = (
|
||||||
baseX: number,
|
baseX: number,
|
||||||
baseY: number
|
baseY: number
|
||||||
): RectShape => {
|
): RectShape => {
|
||||||
const absoluteTransformInverse = matrixInvert([
|
|
||||||
[node.absoluteTransform[0][0], node.absoluteTransform[0][1]],
|
|
||||||
[node.absoluteTransform[1][0], node.absoluteTransform[1][1]]
|
|
||||||
]);
|
|
||||||
|
|
||||||
console.log(node.absoluteTransform, absoluteTransformInverse);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: 'rect',
|
type: 'rect',
|
||||||
name: node.name,
|
name: node.name,
|
||||||
fills: translateFills(node.fills, node.width, node.height),
|
fills: translateFills(node.fills, node.width, node.height),
|
||||||
transform: {
|
|
||||||
a: node.absoluteTransform[0][0],
|
|
||||||
b: node.absoluteTransform[1][0],
|
|
||||||
c: node.absoluteTransform[0][1],
|
|
||||||
d: node.absoluteTransform[1][1],
|
|
||||||
e: 0,
|
|
||||||
f: 0
|
|
||||||
},
|
|
||||||
transformInverse: absoluteTransformInverse
|
|
||||||
? {
|
|
||||||
a: absoluteTransformInverse[0][0],
|
|
||||||
b: absoluteTransformInverse[1][0],
|
|
||||||
c: absoluteTransformInverse[0][1],
|
|
||||||
d: absoluteTransformInverse[1][1],
|
|
||||||
e: 0,
|
|
||||||
f: 0
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
rotation: -node.rotation < 0 ? -node.rotation + 360 : -node.rotation,
|
|
||||||
...transformDimensionAndPosition(node, baseX, baseY),
|
...transformDimensionAndPosition(node, baseX, baseY),
|
||||||
...transformSceneNode(node),
|
...transformSceneNode(node),
|
||||||
...transformBlend(node)
|
...transformBlend(node)
|
||||||
|
|
Loading…
Reference in a new issue