diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-06-22 22:29:23 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-06-22 22:29:23 -0400 |
| commit | 0c527cc51e896f57d15c399c28c8c66c16d1cc59 (patch) | |
| tree | 56372ff3b6600ce22ec3c4b52bbe22191ae995bf /lib/elements | |
| parent | fea7db09905e7218b561842ee935f8069433b040 (diff) | |
starting point specified by fill_start command
Diffstat (limited to 'lib/elements')
| -rw-r--r-- | lib/elements/auto_fill.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/elements/auto_fill.py b/lib/elements/auto_fill.py index 504bae2a..a2c63bd9 100644 --- a/lib/elements/auto_fill.py +++ b/lib/elements/auto_fill.py @@ -100,13 +100,21 @@ class AutoFill(Fill): def fill_shape(self): return self.shrink_or_grow_shape(self.expand) + def get_starting_point(self, last_patch): + # If there is a "fill_start" Command, then use that; otherwise pick + # the point closest to the end of the last patch. + + if self.get_command('fill_start'): + return self.get_command('fill_start').target_point + elif last_patch: + return last_patch.stitches[-1] + else: + return None + def to_patches(self, last_patch): stitches = [] - if last_patch is None: - starting_point = None - else: - starting_point = last_patch.stitches[-1] + starting_point = self.get_starting_point(last_patch) if self.fill_underlay: stitches.extend(auto_fill(self.underlay_shape, |
