Skip to content

Commit 9db919a

Browse files
authored
Merge pull request #905 from rgantzos/main
Fix `paint-align` not working with non-gradient fills
2 parents 8e3069d + e06c911 commit 9db919a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

features/paint-align/script.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ export default async function ({ feature }) {
7575
items[i].segments[seg]._point._y += adjustY;
7676
}
7777

78-
for (var comp in (items[i].fillColor?._components || [])) {
79-
items[i].fillColor._components[comp].x += adjustX;
80-
items[i].fillColor._components[comp].y += adjustY;
78+
if (items[i].fillColor._type === "gradient") {
79+
for (var comp in items[i].fillColor?._components || []) {
80+
items[i].fillColor._components[comp].x += adjustX;
81+
items[i].fillColor._components[comp].y += adjustY;
82+
}
8183
}
8284
}
8385

0 commit comments

Comments
 (0)