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/sorted.cpp | |
parent | b9d111d0136f32d1c43b12eb6e5595fcead9c025 (diff) |
dumb ui changes
Diffstat (limited to 'src/sorted.cpp')
-rw-r--r-- | src/sorted.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/sorted.cpp b/src/sorted.cpp index 1553bf9..948c6f6 100644 --- a/src/sorted.cpp +++ b/src/sorted.cpp @@ -299,16 +299,7 @@ Layer_SortAll(project_state *State, memory *Memory, sorted_layer_array *LayerEntry = &SortedLayerStart[Idx]; block_layer *Layer = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, LayerEntry->Block_Layer_Index); if (Layer->IsSelected & 0x01) { - for (int a = i+1; a < SortedCompStart->LayerCount; a++) { - int PrevIdx = a + FauxIncrement - 1; - sorted_layer_array *PrevLayerEntry = &SortedLayerStart[PrevIdx]; - int NextIdx = a + FauxIncrement; - sorted_layer_array *NextLayerEntry = &SortedLayerStart[NextIdx]; - if (NextLayerEntry->SortedOffset == PrevLayerEntry->SortedOffset) - NextLayerEntry->SortedOffset -= 1; - else - break; - } + // Sort_OffsetDupes(Memory, SortedLayerStart, Layer, LayerEntry, i, FauxIncrement, SortedCompStart->LayerCount, 1); uint8 *Address_Start = (uint8 *)(LayerEntry); uint8 *Address_End = (uint8 *)(&SortedLayerStart[SortedCompStart->LayerCount + FauxIncrement]) - 1; Assert(SortedCompStart->CurrentSortIndex != (SortedCompStart->LayerCount + SortedCompStart->FakeLayerCount)); @@ -318,6 +309,17 @@ Layer_SortAll(project_state *State, memory *Memory, Assert(FakeLayerEntry->Block_Layer_Index == LayerEntry->Block_Layer_Index); FakeLayerEntry->IsFake = true; FauxIncrement++; + + sorted_layer_array *PrevLayerEntry = FakeLayerEntry; + for (int a = i+1; a < SortedCompStart->LayerCount; a++) { + int NextIdx = a + FauxIncrement; + sorted_layer_array *NextLayerEntry = &SortedLayerStart[NextIdx]; + if (NextLayerEntry->SortedOffset == PrevLayerEntry->SortedOffset) + NextLayerEntry->SortedOffset -= 1; + else + break; + PrevLayerEntry = NextLayerEntry; + } } i++; } |