0
Fork 0
mirror of https://github.com/penpot/penpot-plugins.git synced 2025-01-21 06:02:34 -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>
</svg>`;
const shape = penpot.createShapeFromSvg(iconStr);
const center = penpot.viewport.center;
shape.x = center.x;
shape.y = center.y;
if (shape) {
const center = penpot.viewport.center;
shape.x = center.x;
shape.y = center.y;
}
}
function createGrid() {
@ -242,8 +244,10 @@ function createGrid() {
for (let row = 0; row < numRows; row++) {
for (let col = 0; col < numCols; col++) {
const text = penpot.createText(`${row + 1} - ${col + 1}`);
text.growType = 'auto-width';
grid.appendChild(text, row + 1, col + 1);
if (text) {
text.growType = 'auto-width';
grid.appendChild(text, row + 1, col + 1);
}
}
}
}
@ -340,8 +344,10 @@ function createColors() {
flex.justifyContent = 'center';
const text = penpot.createText(color.name);
text.growType = 'auto-width';
board.appendChild(text);
if (text) {
text.growType = 'auto-width';
board.appendChild(text);
}
}
}
}