Issue #39: fix shape direction processing.

This commit is contained in:
Sergey Vartanov 2021-07-04 22:49:12 +03:00
parent 65c50be6fe
commit 9af7d5f2d9
2 changed files with 12 additions and 5 deletions

View file

@ -64,8 +64,11 @@ class Shape:
"""
shape = cls(path, offset, id_, name)
if "right_directed" in structure:
shape.is_right_directed = structure["right_directed"]
if "directed" in structure:
if structure["directed"] == "right":
shape.is_right_directed = True
if structure["directed"] == "left":
shape.is_right_directed = False
if "emoji" in structure:
emojis = structure["emoji"]

View file

@ -360,9 +360,13 @@ class Scheme:
for key in ["direction", "camera:direction"]:
if key in tags:
if DirectionSet(tags[key]).is_right() is False:
for specification in main_icon.shape_specifications:
if specification.shape.is_right_directed is True:
for specification in main_icon.shape_specifications:
if (
DirectionSet(tags[key]).is_right() is False
and specification.shape.is_right_directed is True
or specification.shape.is_right_directed is True
and specification.shape.is_right_directed is False
):
specification.flip_horizontally = True
return returned, priority