Skip to content

Commit

Permalink
Also draw in preview if glyph is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jenskutilek committed Feb 18, 2024
1 parent 2b397e7 commit 373669f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Scrawl.glyphsReporter/Contents/Resources/plugin.py
Expand Up @@ -18,6 +18,27 @@ class ScrawlReporter(ReporterPlugin):
def settings(self) -> None:
self.menuName = Glyphs.localize({"en": u"Scrawl"})

@objc.python_method
def background(self, layer) -> None:
# Always show the drawing in the current layer background
currentController = self.controller.view().window().windowController()
if currentController:
tool = currentController.toolDrawDelegate()
if tool.isKindOfClass_(NSClassFromString("GlyphsToolText")) \
or tool.isKindOfClass_(NSClassFromString("GlyphsToolHand")) \
or tool.isKindOfClass_(NSClassFromString("ScrawlTool")):
return

self.draw_layer(layer)

@objc.python_method
def preview(self, layer) -> None:
# In preview, show only if the layer has neither components nor paths
if layer.shapes:
return

self.draw_layer(layer)

@objc.python_method
def draw_layer(self, layer) -> None:

Expand Down

0 comments on commit 373669f

Please sign in to comment.