diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2022-04-24 08:27:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-24 08:27:42 +0200 |
| commit | f9d57f6ea51ea8da186c41b70950b7d87fa2c20b (patch) | |
| tree | 7c2664fc201933b64cc224adb28ff717e6f08c61 /lib/extensions/lettering.py | |
| parent | 4058712139b56a2419e01db700581b3c9554a88a (diff) | |
Fix lettering scale, etc. (#1620)
* fix lettering scale
* adapt to updated inkex: transform operator, selections
* fix #1597
* no traceback error message on broken satin columns
* highlight troubleshoot "steps to solve" through additional headline
* set a minimum value for running stitch repeats
* rename "import" thread list to "apply" thread list
Diffstat (limited to 'lib/extensions/lettering.py')
| -rw-r--r-- | lib/extensions/lettering.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/extensions/lettering.py b/lib/extensions/lettering.py index 35509eb6..658f2bc7 100644 --- a/lib/extensions/lettering.py +++ b/lib/extensions/lettering.py @@ -9,10 +9,11 @@ import sys from base64 import b64decode import appdirs -import inkex import wx import wx.adv +import inkex + from ..elements import nodes_to_elements from ..gui import PresetsPanel, SimulatorPreview, info_dialog from ..i18n import _ @@ -272,12 +273,15 @@ class LetteringFrame(wx.Frame): font.render_text(self.settings.text, destination_group, back_and_forth=self.settings.back_and_forth, trim=self.settings.trim) except FontError as e: if raise_error: - inkex.errormsg("Error: Text cannot be applied to the document.\n%s" % e) + inkex.errormsg(_("Error: Text cannot be applied to the document.\n%s") % e) return else: pass - if self.settings.scale != 100: + # destination_group isn't always the text scaling group (but also the parent group) + # the text scaling group label is dependend on the user language, so it would break in international file exchange if we used it + # scaling (correction transform) on the parent group is already applied, so let's use that for recognition + if self.settings.scale != 100 and not destination_group.get('transform', None): destination_group.attrib['transform'] = 'scale(%s)' % (self.settings.scale / 100.0) def generate_patches(self, abort_early=None): @@ -395,10 +399,10 @@ class Lettering(CommandsExtension): self.cancelled = True def get_or_create_group(self): - if self.svg.selected: + if self.svg.selection: groups = set() - for node in self.svg.selected.values(): + for node in self.svg.selection: if node.tag == SVG_GROUP_TAG and INKSTITCH_LETTERING in node.attrib: groups.add(node) |
