summaryrefslogtreecommitdiff
path: root/src/createcalls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/createcalls.cpp')
-rw-r--r--src/createcalls.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/createcalls.cpp b/src/createcalls.cpp
index bf9eea2..09bcea5 100644
--- a/src/createcalls.cpp
+++ b/src/createcalls.cpp
@@ -688,9 +688,9 @@ Property_IsGraphSelected(memory *Memory, property_channel *Property, uint16 *Arr
}
// TODO(fox): Add different modes (all dupes on top, each dupe above its layer, two for bottom)
-void
-SortUnionTest(memory *Memory, sorted_layer_array *SortedLayerStart, block_layer *StartLayer,
- int i, int FauxIncrement, int LayerCount, int Mode)
+static void
+Sort_OffsetDupes(memory *Memory, sorted_layer_array *SortedLayerStart, block_layer *StartLayer,
+ int i, int FauxIncrement, int LayerCount, int Mode)
{
block_layer *PrevLayer = StartLayer;
for (int a = i+1; a < LayerCount; a++) {
@@ -698,7 +698,7 @@ SortUnionTest(memory *Memory, sorted_layer_array *SortedLayerStart, block_layer
uint32 NextIndex_Physical = NextSortEntry->Block_Layer_Index;
block_layer *NextLayer = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, NextIndex_Physical);
if (NextLayer->Vertical_Offset == PrevLayer->Vertical_Offset) {
- if (Mode == 0) {
+ if (Mode == 0 && !NextSortEntry->IsFake) {
History_Action_Swap(Memory, F_Layers, sizeof(NextLayer->Vertical_Offset), &NextLayer->Vertical_Offset);
NextLayer->Vertical_Offset -= 1;
} else {
@@ -792,7 +792,7 @@ Project_Layer_Duplicate(project_data *File, project_state *State, memory *Memory
Layer_Select(Memory, State, Memory_Block_LazyIndexAtAddress(Memory, F_Layers, NewLayer));
NewLayer->Vertical_Offset--;
- SortUnionTest(Memory, SortedLayerStart, NewLayer, i, 0, LayerCount, 0);
+ Sort_OffsetDupes(Memory, SortedLayerStart, NewLayer, i, 0, LayerCount, 0);
Assert(!NewLayer->x.Keyframe_Count);
Assert(!NewLayer->y.Keyframe_Count);