Skip to content

Commit

Permalink
🌆 Warn about not supported image fill properties
Browse files Browse the repository at this point in the history
  • Loading branch information
luisbosque committed Nov 21, 2022
1 parent d0e331c commit eb5dc8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions converter/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def convert_fill(fig_node: dict, fig_fill: dict) -> Fill:
isEnabled=fig_fill["visible"],
)
case {"type": "IMAGE"}:
if "paintFilter" in fig_fill:
utils.log_conversion_warning("STY003", fig_node)
return Fill.Image(
f'images/{fig_fill["image"]["filename"]}',
patternFillType=PATTERN_FILL_TYPE[fig_fill["imageScaleMode"]],
Expand Down
1 change: 1 addition & 0 deletions converter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def get_style_table_override(fig_item):
"SHP001": "contains a line with at least one 'Reversed triangle' end. This type of marker does not exist in Sketch. It has been converted to a 'Line' type marker",
"STY001": "contains a layer blur and a background blur. Only one will be converted",
"STY002": "contains a DIAMOND gradient, which is not supported. It is converted to a RADIAL gradient",
"STY003": "contains a image fill property, which is not supported. The extra properties will be ignored",
"SYM001": "references an invalid symbol. It will be converted to an empty placeholder group",
"SYM002": "overrides unsupported properties: {props}. The override will be ignored",
"SYM003": "overrides unsupported properties: {props}. The instance will be detached",
Expand Down

0 comments on commit eb5dc8d

Please sign in to comment.