mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 05:33:02 -05:00
madness
This commit is contained in:
parent
eca913eadc
commit
9df47e496f
1 changed files with 18 additions and 0 deletions
|
@ -4,6 +4,7 @@ import {
|
|||
transformSceneNode
|
||||
} from '@plugin/transformers/partials';
|
||||
import { translateFills } from '@plugin/translators';
|
||||
import { matrixInvert } from '@plugin/utils/matrixInvert';
|
||||
|
||||
import { RectShape } from '@ui/lib/types/rect/rectShape';
|
||||
|
||||
|
@ -12,6 +13,13 @@ export const transformRectangleNode = (
|
|||
baseX: number,
|
||||
baseY: number
|
||||
): 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 {
|
||||
type: 'rect',
|
||||
name: node.name,
|
||||
|
@ -24,6 +32,16 @@ export const transformRectangleNode = (
|
|||
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),
|
||||
...transformSceneNode(node),
|
||||
|
|
Loading…
Reference in a new issue