Skip to content

Commit

Permalink
Enable deletion of special types like anchors named '*top'. (Fix #4) …
Browse files Browse the repository at this point in the history
…Thx Claus
  • Loading branch information
mekkablue committed May 7, 2024
1 parent 506efe8 commit 1d2780f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions MagicRemove.glyphsPalette/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<key>CFBundleName</key>
<string>Magic Remover</string>
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<string>1.2.1</string>
<key>CFBundleVersion</key>
<string>16</string>
<string>17</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright, Rainer Erich Scheichelbauer, 2020</string>
<key>NSPrincipalClass</key>
Expand All @@ -29,6 +29,6 @@
<key>productPageURL</key>
<string>https://github.com/mekkablue/MagicRemover</string>
<key>productReleaseNotes</key>
<string>Cmd-click creates backups in background layers first.</string>
<string>Enable deletion of special types like anchors named '*top'. (Fix #4)</string>
</dict>
</plist>
10 changes: 5 additions & 5 deletions MagicRemove.glyphsPalette/Contents/Resources/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ def eraseSelectedItemsOnAllMasters_(self, sender=None):
hintIDs = []

for thisItem in currentLayer.selection:
if type(thisItem) == GSNode:
if isinstance(thisItem, GSNode):
pathNodeIndexes.append(
currentLayer.indexPathOfNode_(thisItem)
)
elif type(thisItem) == GSAnchor:
elif isinstance(thisItem, GSAnchor):
anchorNames.append(
thisItem.name
)
elif type(thisItem) == GSComponent:
elif isinstance(thisItem, GSComponent):
componentIndexes.append(
thisItem.elementIndex()
)
elif type(thisItem) == GSHint:
elif isinstance(thisItem, GSHint):
if thisItem.isCorner:
hintIDs.append(
hintID(thisItem)
Expand Down Expand Up @@ -157,7 +157,7 @@ def eraseSelectedItemsOnAllMasters_(self, sender=None):
else:
for node in removeNodes:
path = node.parent
if path is None or node not in path.nodes: # it might be remove already
if path is None or node not in path.nodes: # can be removed already
continue
path.removeNodeCheckKeepShape_normalizeHandles_(node, True)
if len(path.nodes) == 0:
Expand Down

0 comments on commit 1d2780f

Please sign in to comment.