Conversation
a1a86ec to
ada528f
Compare
There was a problem hiding this comment.
Wondering: Can this just be specified on RenderFollowerLayer/CompositedTransformFollower as a callback instead of requiring a subclass?
There was a problem hiding this comment.
Yes, it could be. My reasoning on this was that the word "transform" in the name meant that we could someday add scaling or rotation to the transformations in addition to offsets, and then it seemed like you'd want to have one subclass instead of multiple callbacks.
Also, for my use case, it was helpful for it to be a subclass that could hold state used to compute the offset, and if it was just a callback, I'd have to make a class anyhow to hold the state and keep the instance somewhere and pass a call to that object's function for computing it, so this was easier for my use case, which makes a weak case (weak because of a sample size of 1) that this would be useful for others too.
f12b1ce to
d73cf4c
Compare
8b93ba0 to
6a5d991
Compare
|
Closing this, since we decided that we can't use this for my use case anyhow, since I need to do layout when the menus change location, and this won't allow that. We're going to wait to add API for when there's a use case for it. That said, this could be a useful thing to add if someone needs something similar in the future where positioning is all that is needed. |
Description
This adds a delegate class that can override the transform used by a
CompositedTransformFollowerso that it can incorporate additional information other than the alignments and leader/follower sizes at the time of the transform.I needed this in order to do cascading menus properly so that they wouldn't be delayed by a frame when their connected menu button moved.
Tests