MCPcopy Create free account
hub / github.com/bernaferrari/FigmaToCode / htmlRotation

Function htmlRotation

packages/backend/src/html/builderImpl/htmlBlend.ts:112–127  ·  view source on GitHub ↗
(node: AltNode, isJsx: boolean)

Source from the content-addressed store, hash-verified

110 * if rotation was changed, let it be perceived. Therefore, 1 => 45
111 */
112export const htmlRotation = (node: AltNode, isJsx: boolean): string[] => {
113 const rotation =
114 -Math.round((node.rotation || 0) + (node.cumulativeRotation || 0)) || 0;
115
116 if (rotation !== 0) {
117 return [
118 formatWithJSX(
119 "transform",
120 isJsx,
121 `rotate(${numberToFixedString(rotation)}deg)`,
122 ),
123 formatWithJSX("transform-origin", isJsx, "top left"),
124 ];
125 }
126 return [];
127};

Callers 1

blendMethod · 0.90

Calls 2

formatWithJSXFunction · 0.90
numberToFixedStringFunction · 0.90

Tested by

no test coverage detected