diff --git a/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py b/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py index 1bb4718..03fc7de 100644 --- a/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py +++ b/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py @@ -1978,5 +1978,6 @@ def designspaceEditorInstancesDidChange(self, notification): designspaceBundle = ExtensionBundle(path=pathForBundle) path = "/Users/frederik/Documents/dev/letterror/mutatorSans/MutatorSans.designspace" - #path = None + # path = "/Users/frederik/Documents/fontsGit/RoboType/RF.designspace" + # path = None DesignspaceEditorController(path) diff --git a/DesignspaceEditor2.roboFontExt/lib/main.py b/DesignspaceEditor2.roboFontExt/lib/main.py index f5c9318..5feaa9b 100644 --- a/DesignspaceEditor2.roboFontExt/lib/main.py +++ b/DesignspaceEditor2.roboFontExt/lib/main.py @@ -332,10 +332,13 @@ def designspaceEventExtractor(subscriber, info): info[attribute] = data[attribute] +def designspaceEditorEventEligibility(subscriber, notification): + if not hasattr(subscriber, "operator"): + return True + elif "designspace" not in notification: + return True + return notification["designspace"] == subscriber.operator -eventEligibilityFunctionMap = dict( - -) for event in designspaceEvents: documentation = "".join([" " + c if c.isupper() else c for c in event.replace("designspaceEditor", "")]).lower().strip() @@ -346,7 +349,7 @@ def designspaceEventExtractor(subscriber, info): dispatcher="roboFont", documentation=f"Send when a Designspace Editor {documentation}.", eventInfoExtractionFunction=designspaceEventExtractor, - eventEligibilityFunction=eventEligibilityFunctionMap.get(event, None), + eventEligibilityFunction=designspaceEditorEventEligibility, delay=.2, debug=True )