summaryrefslogtreecommitdiff
path: root/src/sorted.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sorted.cpp')
-rw-r--r--src/sorted.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sorted.cpp b/src/sorted.cpp
index 9f2e135..46b9549 100644
--- a/src/sorted.cpp
+++ b/src/sorted.cpp
@@ -108,10 +108,14 @@ Layer_Sort_DisplayOffset(project_state *State, memory *Memory,
}
}
if (SortedCompStart->LayerCount > 1) {
- block_layer *Layer_Top = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, SortedLayerStart[SortedCompStart->LayerCount - 1].Block_Layer_Index);
- block_layer *Layer_Bottom = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, SortedLayerStart[0].Block_Layer_Index);
- real32 SmallestY = Layer_Top->Vertical_Offset;
- real32 LargestY = Layer_Bottom->Vertical_Offset;
+ sorted_layer_array LayerEntry_Top = SortedLayerStart[SortedCompStart->LayerCount - 1];
+ sorted_layer_array LayerEntry_Bottom = SortedLayerStart[0];
+ real32 SmallestY = LayerEntry_Top.SortedOffset;
+ real32 LargestY = LayerEntry_Bottom.SortedOffset;
+ // block_layer *Layer_Top = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, SortedLayerStart[SortedCompStart->LayerCount - 1].Block_Layer_Index);
+ // block_layer *Layer_Bottom = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, SortedLayerStart[0].Block_Layer_Index);
+ // real32 SmallestY = Layer_Top->Vertical_Offset;
+ // real32 LargestY = Layer_Bottom->Vertical_Offset;
DisplayOffset = LargestY - SmallestY + 2 + DisplayOffset;
}
return DisplayOffset;