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:
parent
218a62833d
commit
00772613eb
1 changed files with 13 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue