diff options
author | Fox Caminiti <fox@foxcam.net> | 2023-02-08 23:58:05 -0500 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2023-02-08 23:58:05 -0500 |
commit | 3d2e5b594b1872f866a698014c97ee4e98de6259 (patch) | |
tree | a66540c6d0b87a286da793ef8371c2be9e7fb77f /src/layer.cpp | |
parent | b9d111d0136f32d1c43b12eb6e5595fcead9c025 (diff) |
dumb ui changes
Diffstat (limited to 'src/layer.cpp')
-rw-r--r-- | src/layer.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/layer.cpp b/src/layer.cpp index 9a3a0a4..0b278e5 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -230,7 +230,22 @@ Interact_BoxSelect_End(project_data *File, project_state *State, memory *Memory) } static void -Layer_DeselectAll(project_data *File, project_state *State, memory *Memory, bool32 AllowComp) { +Layer_ApplyPreviousSelection(project_data *File, project_state *State, memory *Memory) +{ + if (State->PreviousSelectionCount) { + for (int a = 0; a < State->PreviousSelectionCount; a++) { + int Idx = State->PreviousSelection[a]; + block_layer *Layer = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, Idx); + Layer->IsSelected = 0x01; + } + State->MostRecentlySelectedLayer = State->PreviousSelection[0]; + } +} + +static void +Layer_DeselectAll(project_data *File, project_state *State, memory *Memory, bool32 AllowComp, bool32 RecordSelection) { + if (RecordSelection && State->PreviousSelectionCount) + State->PreviousSelectionCount = 0; int h = 0, c = 0, i = 0; bool32 ShiftLayers = false; while (Block_Loop(Memory, F_Layers, File->Layer_Count, &h, &c, &i)) { @@ -239,6 +254,10 @@ Layer_DeselectAll(project_data *File, project_state *State, memory *Memory, bool ShiftLayers = 1; } else { if (!(AllowComp && Layer->IsSelected & 0x02)) { + if (Layer->IsSelected & 0x01 && RecordSelection) { + State->PreviousSelection[State->PreviousSelectionCount] = i; + State->PreviousSelectionCount++; + } Layer->IsSelected = 0x00; } } |