mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-12 18:31:18 +00:00
The panel decoded the layer's image once, when it opened, so switching the layer's texture from the picker left it showing the old photo. The 3D view had already moved on, since decode_height_texture() reads layer.image_data and that had changed, so the panel and the model disagreed about what was being adjusted. Now the panel notices the image_data it decoded from is no longer the layer's and re-reads it, keeping the slider positions: the user is adjusting this layer, and the sliders are what they have just set. Possible because the panel is a window rather than a popup - the picker is reachable while it is open, which is what makes this case exist at all. Two more ways the open panel could end up pointing at the wrong thing, found while fixing that one: Slots are numbered per volume, so selecting a different object rebound the panel to whatever layer held the same slot on the newly selected one - a different image under a panel opened for another object. The panel now records the volume it was opened on and closes when the selection leaves it. And closing it reverted preview_adjust through texture_volume(), which answers for the current selection. Since a selection change is one of the ways to close it, that reverted the wrong volume's layer: it cleared an adjustment the user never made and left the real one live on the original object, which would have gone on displacing from the adjusted image with no panel open. The revert now finds the volume by the id recorded at open time.