0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-21 22:22:45 -05:00

fix(poc-state-plugin): fix typing problem

This commit is contained in:
alonso.torres 2024-06-24 11:11:19 +02:00 committed by Alonso Torres
parent 218a62833d
commit 00772613eb

View file

@ -203,9 +203,11 @@ function addIcon() {
</g> </g>
</svg>`; </svg>`;
const shape = penpot.createShapeFromSvg(iconStr); const shape = penpot.createShapeFromSvg(iconStr);
if (shape) {
const center = penpot.viewport.center; const center = penpot.viewport.center;
shape.x = center.x; shape.x = center.x;
shape.y = center.y; shape.y = center.y;
}
} }
function createGrid() { function createGrid() {
@ -242,10 +244,12 @@ function createGrid() {
for (let row = 0; row < numRows; row++) { for (let row = 0; row < numRows; row++) {
for (let col = 0; col < numCols; col++) { for (let col = 0; col < numCols; col++) {
const text = penpot.createText(`${row + 1} - ${col + 1}`); const text = penpot.createText(`${row + 1} - ${col + 1}`);
if (text) {
text.growType = 'auto-width'; text.growType = 'auto-width';
grid.appendChild(text, row + 1, col + 1); grid.appendChild(text, row + 1, col + 1);
} }
} }
}
} }
function createColors() { function createColors() {
@ -340,10 +344,12 @@ function createColors() {
flex.justifyContent = 'center'; flex.justifyContent = 'center';
const text = penpot.createText(color.name); const text = penpot.createText(color.name);
if (text) {
text.growType = 'auto-width'; text.growType = 'auto-width';
board.appendChild(text); board.appendChild(text);
} }
} }
}
} }
function increaseCounter() { function increaseCounter() {