summaryrefslogtreecommitdiff
path: root/lib/sew_stack/stitch_layers/mixins/path.py
blob: 88e5419d0eac24d70c3042ea744eac44ba3e0e1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from ..stitch_layer_editor import Category, Property
from ....i18n import _
from ....utils import DotDict, Point


class PathPropertiesMixin:
    @classmethod
    def path_properties(cls):
        return Category(_("Path")).children(
            Property("reverse_path", _("Reverse path"), type=bool,
                     help=_("Reverse the path when stitching this layer."))
        )


class PathMixin:
    config: DotDict
    paths: 'list[list[Point]]'

    def get_paths(self):
        paths = self.paths

        if self.config.reverse_path:
            paths.reverse()
            for path in paths:
                path.reverse()

        return paths