mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-01-26 01:58:04 -05:00
When a layer is initialized, we do not yet know its bbox, so we cannot fit the stage view to the layer. We have to wait for the bbox calculation to finish. Previously, we had no way to wait unti lthat bbox calculation was complete to take an action. For example, this means we could not fit the layers to the stage immediately after creating a new layer, bc we don't know the dimensions of the layer yet. This callback lets us do that. When creating a new canvas from an image, we now... - Register a bbox update callback to fit the layers to stage - Layer is created - Canvas initializes the layer's entity adapter module (layer's width and height are set to zero at this point) - Canvas calculates the bbox - Bbox is updated (width and height are now correct) - Callback is ran, fitting layer to stage