mirror of
https://github.com/enzet/map-machine.git
synced 2025-06-02 02:41:57 +02:00
Change icon sorting in grid.
Sort icons in grid by shape identifiers instead of tag priority.
This commit is contained in:
parent
1aace77aef
commit
aad7b25202
4 changed files with 11 additions and 3 deletions
BIN
doc/grid.png
BIN
doc/grid.png
Binary file not shown.
Before ![]() (image error) Size: 71 KiB After ![]() (image error) Size: 74 KiB ![]() ![]() |
BIN
doc/trees.png
BIN
doc/trees.png
Binary file not shown.
Before ![]() (image error) Size: 166 KiB After ![]() (image error) Size: 169 KiB ![]() ![]() |
|
@ -91,13 +91,13 @@ def draw_all_icons(
|
||||||
", ".join(sorted(extractor.shapes.keys() - specified_ids)) + "."
|
", ".join(sorted(extractor.shapes.keys() - specified_ids)) + "."
|
||||||
)
|
)
|
||||||
|
|
||||||
for icon in icons: # type: Icon
|
for icon in icons:
|
||||||
icon.draw_to_file(join(
|
icon.draw_to_file(join(
|
||||||
output_directory, f"{' + '.join(icon.get_names())}.svg"
|
output_directory, f"{' + '.join(icon.get_names())}.svg"
|
||||||
))
|
))
|
||||||
|
|
||||||
draw_grid(
|
draw_grid(
|
||||||
output_file_name, icons, columns, step,
|
output_file_name, sorted(icons), columns, step,
|
||||||
background_color=background_color
|
background_color=background_color
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -362,7 +362,15 @@ class Icon:
|
||||||
self.shape_specifications += specifications
|
self.shape_specifications += specifications
|
||||||
|
|
||||||
def __eq__(self, other) -> bool:
|
def __eq__(self, other) -> bool:
|
||||||
return sorted(self.shape_specifications) == sorted(other.shape_specifications)
|
return sorted(self.shape_specifications) == sorted(
|
||||||
|
other.shape_specifications
|
||||||
|
)
|
||||||
|
|
||||||
|
def __lt__(self, other) -> bool:
|
||||||
|
return (
|
||||||
|
sorted(self.shape_specifications)[0].shape.id_
|
||||||
|
< sorted(other.shape_specifications)[0].shape.id_
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue