2021-10-21 14:24:40 +00:00
|
|
|
# Authors: see git history
|
|
|
|
#
|
|
|
|
# Copyright (c) 2021 Authors
|
|
|
|
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
|
|
|
|
|
|
|
|
import inkex
|
|
|
|
|
|
|
|
from ..i18n import _
|
2022-01-28 20:54:20 +00:00
|
|
|
from ..marker import set_marker
|
|
|
|
from ..svg.tags import EMBROIDERABLE_TAGS
|
2021-10-21 14:24:40 +00:00
|
|
|
from .base import InkstitchExtension
|
|
|
|
|
|
|
|
|
|
|
|
class SelectionToGuideLine(InkstitchExtension):
|
|
|
|
|
|
|
|
def effect(self):
|
|
|
|
if not self.get_elements():
|
|
|
|
return
|
|
|
|
|
|
|
|
if not self.svg.selected:
|
2022-01-28 20:54:20 +00:00
|
|
|
inkex.errormsg(_("Please select at least one object to be marked as a guide line."))
|
2021-10-21 14:24:40 +00:00
|
|
|
return
|
|
|
|
|
2022-01-28 20:54:20 +00:00
|
|
|
for pattern in self.get_nodes():
|
|
|
|
if pattern.tag in EMBROIDERABLE_TAGS:
|
|
|
|
set_marker(pattern, 'start', 'guide-line')
|