You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
now holdNotifications only rejects a notification if the last added notification is the same.
This does not work as expected, fe: setting a contour.dirty = True automatically send an Glyph.Changed notification as each glyph is subscribed to his contour changes.
This ends up with a stack duplicated notifications
Should it not test if the notification is already being held?
like: if n not in self._holds[key]["notifications"]:
the only thing is that the order could be important... but also maybe not really...
fromdefconimportFontclassTestObserver(object):
defaction(self, notification):
printnotification.namef=Font()
g=f.newGlyph("a")
p=g.getPen()
p.moveTo((100, 100))
p.lineTo((200, 200))
p.endPath()
observer=TestObserver()
g.addObserver(observer, "action", "Glyph.Changed")
g.holdNotifications()
g[0].dirty=Trueg.dirty=True# this will be rejectedg[0].dirty=True# this will not be rejected but is the same as the previous one#g.dirty = True # this will be rejectedg[0].dirty=True# this will not be rejected but is the same as the first oneforholds, itemsing.dispatcher._holds.items():
printlen(items.get("notifications"))
fornotificationinitems.get("notifications", []):
print" ", notification[0]
print# release g.releaseHeldNotifications()
The text was updated successfully, but these errors were encountered:
now
holdNotifications
only rejects a notification if the last added notification is the same.This does not work as expected, fe: setting a
contour.dirty = True
automatically send anGlyph.Changed
notification as each glyph is subscribed to his contour changes.This ends up with a stack duplicated notifications
see https://github.com/typesupply/defcon/blob/master/Lib/defcon/tools/notifications.py#L140
Should it not test if the notification is already being held?
like:
if n not in self._holds[key]["notifications"]:
the only thing is that the order could be important... but also maybe not really...
The text was updated successfully, but these errors were encountered: