Opened 8 years ago
Closed 5 years ago
#25 closed enhancement (fixed)
Right clicking a layer - show previous state instead of show all layers
|Reported by:||ilija.melentijevic||Owned by:||Thomas Bernard|
-right click visible layer to SOLO it (hide all other layers)
-right click again to show all layers
-right click visible layer to SOLO it (hide all other layers) - same as before
-right click again to revert to state before the first click (that is, show layers that were on, instead of showing all)
No idea how tricky this is (I suspect it might involve saving the previous state) but I just noticed that it slows down working with layers, having to manually hide helper layers again every now and then
Change History (6)
comment:1 by , 5 years ago
|Status:||new → accepted|
comment:3 by , 5 years ago
Hi thanks for taking this task. From looking at code, I see one issue : Main and Spare page., these should have their own separate variables. I suggest you use globals called Main_layers_visible_previous and Spare_layers_visible_previous , and exchange them when swapping Main<->Spare (an existing function does it for all existing Main_* and Spare_*)
I can't remember if you need to limit the number of set bits to the (current) number of layers (after all, you may "save" when there are 6 layers, and try restore after you've deleted 2 of them). I see the existing 0xFFFFFFFF was working, but I really can't remember if it was a special case or if the system actually safely ignored the "useless" bits.
For your info, note that the actual available layers change according to many actions : add, merge, remove, load image, copy to spare (which is one of the only actions that modifies the spare instead of Main_...) undo/redo (Which can change many things at once)... We currently don't track the identity of layers over time and over all these changes, so, well, there is no way to ensure that the "right" layer comes back after save + swap|insert|delete + load. Don't worry about it.
comment:4 by , 5 years ago
yrizoud: have you tried the new code and noticed any issue ?
I can tell you Main_layers_visible are tested for existing layers, but any extra bit is just ignored !
if ((1<<layer) & Main_layers_visible)
comment:5 by , 5 years ago
yrizoud: my last commit addresses the issue you are pointing about Main and Spare page separate variables : https://gitlab.com/GrafX2/grafX2/commit/2928a16e415d070936dc220f803eb086afa70d59
comment:6 by , 5 years ago
|Status:||accepted → closed|
I'm working on this