Files
OrcaSlicer/src
ExPikaPaka 752b356ff0 fix: refresh the image-adjustment panel when the layer's image changes under it
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.
2026-10-12 08:28:08 +02:00
..
…