summaryrefslogtreecommitdiff
path: root/src/imgui_ui_timeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imgui_ui_timeline.cpp')
-rw-r--r--src/imgui_ui_timeline.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/imgui_ui_timeline.cpp b/src/imgui_ui_timeline.cpp
index a85d58e..29b2835 100644
--- a/src/imgui_ui_timeline.cpp
+++ b/src/imgui_ui_timeline.cpp
@@ -466,8 +466,10 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
#else
sprintf(buf, "%s", String->Char);
#endif
- if (UI->TimelinePercentZoomed.y <= 1.0f)
- draw_list->AddText(Layer_ScreenPos_Min, 0xFFFFFFFF, buf);
+ if (UI->TimelinePercentZoomed.y <= 1.0f) {
+ real32 TextX = (Layer_ScreenPos_Min.x > TimelineAbsolutePos.x) ? Layer_ScreenPos_Min.x : TimelineAbsolutePos.x;
+ draw_list->AddText(ImVec2(TextX, Layer_ScreenPos_Min.y), 0xFFFFFFFF, buf);
+ }
if (Layer->IsSelected == 1) {
draw_list->AddRectFilled(Layer_ScreenPos_Min, Layer_ScreenPos_Max, ImColor(0.25f, 0.25f, 0.25f, 0.5f), 2);
@@ -541,8 +543,8 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
block_layer *Layer = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, i);
if (Layer->IsSelected) {
// NOTE(fox): Some data on the tree could be saved here.
- History_Action_Swap(Memory, F_File, sizeof(Layer->Frame_Start), &Layer->Frame_Start);
- History_Action_Swap(Memory, F_File, sizeof(Layer->Frame_End), &Layer->Frame_End);
+ History_Action_Swap(Memory, F_Layers, sizeof(Layer->Frame_Start), &Layer->Frame_Start);
+ History_Action_Swap(Memory, F_Layers, sizeof(Layer->Frame_End), &Layer->Frame_End);
Interact_Evaluate_Layer(Memory, State, Index_Physical, SortedCompStart, SortedLayerStart, &Layer->Frame_Start, &Layer->Frame_End, &Layer->Frame_Offset);
}
}
@@ -580,7 +582,7 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
History_Entry_Commit(Memory, "Toggle visibility");
Commit = true;
}
- History_Action_Swap(Memory, F_File, sizeof(Layer->IsVisible), &Layer->IsVisible);
+ History_Action_Swap(Memory, F_Layers, sizeof(Layer->IsVisible), &Layer->IsVisible);
Layer->IsVisible ^= 1;
}
}
@@ -681,10 +683,10 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
uint32 Index_Physical = SortEntry.Block_Layer_Index;
block_layer *Layer = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, Index_Physical);
// NOTE(fox): Some data on the tree could be saved here.
- History_Action_Swap(Memory, F_File, sizeof(Layer->Vertical_Offset), &Layer->Vertical_Offset);
+ History_Action_Swap(Memory, F_Layers, sizeof(Layer->Vertical_Offset), &Layer->Vertical_Offset);
Layer->Vertical_Offset = SortEntry.SortedOffset;
if (Layer->IsSelected) {
- History_Action_Swap(Memory, F_File, sizeof(Layer->Frame_Offset), &Layer->Frame_Offset);
+ History_Action_Swap(Memory, F_Layers, sizeof(Layer->Frame_Offset), &Layer->Frame_Offset);
Interact_Evaluate_Layer(Memory, State, Index_Physical, SortedCompStart, SortedLayerStart, &Layer->Frame_Start, &Layer->Frame_End, &Layer->Frame_Offset);
}
}