-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
order of registry posibilities #102
Comments
I wondering why the order is going from most specific -> least specific? |
I just hit this issue with a SelectionChanged notification sent from contour, which the glyph watches then sends its own Glyph.SelectionChanged that destroys the representation. @typesupply Could you explain the rationale for the order of notifications:
I expect simply reversing that order should fix this issue. Edit: Although reversing the order fixes the issue with destroyRepresentations, I think destructors should have some special rooting in NotificationCenter so they're guaranteed to be called first. |
I don't remember. That |
similar as other classes in the glyph (contourClass, pointClass, anchorClass, guidelineClass)
when an object is self observing it is subscribed to all notifications, this makes sense in order to destroy representation factories.
But the order of calling observers puts the self observing as third option. see https://github.com/typesupply/defcon/blob/master/Lib/defcon/tools/notifications.py#L146-L151
This causes issues when a factories has no destructive notifications (aka ".Changed" notification) as this is being called afterwards.
a small example to demonstrate this issue.
I don't have any idea to push self observing notifications upfront.
The factories could add all possible notifications but that does not feels right, especially with heavy calculating factories.
The text was updated successfully, but these errors were encountered: