-
Notifications
You must be signed in to change notification settings - Fork 563
Closed
Milestone
Description
There were several issues related to Node bounds calculation and I think it makes sense to keep all discussions in one place. This is actually a complicated task, because bounds calculation requires rendering context and in fact it's only accessible after drawing. However users don't want to think about such implementation details, instead they want to be able to access Node bounds immediately after creation and access actual information even after some updates.
This task might be implemented during several milestones, so we need to provide useful workaround for current issues. So here is a plan:
- We'll provide temporary public utility method to calculate
Nodebounds. This method will create synthetic rendering context and calculate bounds using this context once. This step is workaround to solve current issues. - We'll provide
Node.bounds() -> Rectmethod. This method will work immediately and access actual information. In the first version we'll just use utility method from step 1. - Implementation from step 2 will be very slow and we actually don't need to recalculate bounds on each call, because we can just use cache to remember bounds. Moreover, during rendering we calculate bounds anyway, so if we render
Nodewe don't need to use synthetic context. So on this step we'll provide complicated implementation to make a fast and useful solution to calculate bounds. - Finally, good implementation will allow us to add ability to monitor
Node.boundschanges and it will make possible complicated layouts for nodes.