Skip to content

Commit

Permalink
Import older const/flags
Browse files Browse the repository at this point in the history
  • Loading branch information
takaakifuji committed Apr 30, 2024
1 parent 28b7ba6 commit cdda640
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Binary file modified CJKAnchorPlacement.glyphsTool/Contents/CodeResources
Binary file not shown.
Binary file modified CJKAnchorPlacement.glyphsTool/Contents/MacOS/plugin
Binary file not shown.
8 changes: 5 additions & 3 deletions CJKAnchorPlacement.glyphsTool/Contents/Resources/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
import objc
from GlyphsApp import *
from GlyphsApp.plugins import *
from AppKit import NSApplication, NSGraphicsContext, NSColor, NSMakeRect, NSInsetRect, NSMakePoint, NSAlternateKeyMask, NSBeep, NSNumberFormatter, NSValueTransformer, NSEventTypeLeftMouseDown, NSEventTypeLeftMouseDragged, NSEventTypeMouseMoved, NSEventTypeLeftMouseUp, NSEventTypePressure, NSEventTypeTabletPoint
from AppKit import NSApplication, NSGraphicsContext, NSColor, NSMakeRect, NSInsetRect, NSMakePoint, NSAlternateKeyMask, NSBeep, NSNumberFormatter, NSValueTransformer, NSLeftMouseDown, NSLeftMouseUp, NSMouseMoved, NSLeftMouseDragged

from Foundation import NSNotFound, NSNumber, NSMutableDictionary
import math
import collections
import contextlib

VALID_EVENT_TYPES = (NSLeftMouseDown, NSLeftMouseUp, NSMouseMoved, NSLeftMouseDragged)

@contextlib.contextmanager
def currentGraphicsContext(context=None):
context = context or NSGraphicsContext.currentContext()
Expand Down Expand Up @@ -321,10 +324,9 @@ def background(self, layer):
font = layer.parent.parent
master = font.masters[layer.associatedMasterId or layer.layerId]
event = NSApplication.sharedApplication().currentEvent()
valid_event_types = (NSEventTypeLeftMouseDragged, NSEventTypeMouseMoved, NSEventTypeLeftMouseUp, NSEventTypePressure, NSEventTypeTabletPoint)
arrange_anchors(font, master, layer)
self.update_grid_subdivision(event)
self.sync_values(font, master, layer, needs_round=event.type() in valid_event_types if event else False)
self.sync_values(font, master, layer, needs_round=event.type() in VALID_EVENT_TYPES if event else False)
with currentGraphicsContext() as ctx:
dotted = False
has_unbalanced_palt = sum((1 if value is None else 0 for value in (self.LSBValue, self.RSBValue))) == 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</data>
<key>Resources/plugin.py</key>
<data>
KIJgddwP2E0BZMyWXnUB+520KmE=
uBZM8UQnplFPta0i8hON3J/It/k=
</data>
<key>Resources/toolbar.ai</key>
<data>
Expand Down Expand Up @@ -53,11 +53,11 @@
<dict>
<key>hash</key>
<data>
KIJgddwP2E0BZMyWXnUB+520KmE=
uBZM8UQnplFPta0i8hON3J/It/k=
</data>
<key>hash2</key>
<data>
FzufauSDJm/r2jgE6MgqxCnnGYSnk810dqKntpEMoKY=
lX3DfAJUeJzJwdvkXwmDBw9ZyvRSsaTfyIdlQqgEWuY=
</data>
</dict>
<key>Resources/toolbar.ai</key>
Expand Down

0 comments on commit cdda640

Please sign in to comment.