Right click on a layer toggle SOLO / previous state

Previously, if right clicking the current layer which is the only
one shown, then all layers are shown.

Now right clicking twice on the current layer return to the same
state.

see http://pulkomandy.tk/projects/GrafX2/ticket/25
This commit is contained in:
Thomas Bernard 2017-12-27 22:16:48 +01:00
parent cad9aa53fd
commit 8a67da69cc

View File

@ -34,7 +34,8 @@
void Layer_activate(int layer, short side)
{
word old_layers;
dword old_layers;
static dword layers_backup_for_toggle = 0xFFFFFFFF;
if (layer >= Main_backups->Pages->Nb_layers)
return;
@ -51,12 +52,14 @@ void Layer_activate(int layer, short side)
{
if (Main_layers_visible == (dword)(1<<layer))
{
// Set all layers visible
Main_layers_visible = 0xFFFFFFFF;
// return to previous state (layers that were on before showing
// only this one)
Main_layers_visible = layers_backup_for_toggle;
}
else
{
// Set only this one visible
layers_backup_for_toggle = Main_layers_visible;
Main_layers_visible = 1<<layer;
}
}