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:
		
							parent
							
								
									cad9aa53fd
								
							
						
					
					
						commit
						8a67da69cc
					
				@ -34,7 +34,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void Layer_activate(int layer, short side)
 | 
					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)
 | 
					  if (layer >= Main_backups->Pages->Nb_layers)
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
@ -51,12 +52,14 @@ void Layer_activate(int layer, short side)
 | 
				
			|||||||
      {
 | 
					      {
 | 
				
			||||||
        if (Main_layers_visible == (dword)(1<<layer))
 | 
					        if (Main_layers_visible == (dword)(1<<layer))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          // Set all layers visible
 | 
					          // return to previous state (layers that were on before showing
 | 
				
			||||||
          Main_layers_visible = 0xFFFFFFFF;
 | 
					          // only this one)
 | 
				
			||||||
 | 
					          Main_layers_visible = layers_backup_for_toggle;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          // Set only this one visible
 | 
					          // Set only this one visible
 | 
				
			||||||
 | 
					          layers_backup_for_toggle = Main_layers_visible;
 | 
				
			||||||
          Main_layers_visible = 1<<layer;
 | 
					          Main_layers_visible = 1<<layer;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user