summaryrefslogtreecommitdiff
path: root/my_imgui_widgets.cpp
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2022-08-21 22:05:10 -0400
committerFox Caminiti <fox@foxcam.net>2022-08-21 22:05:10 -0400
commitd03d7187c1881237b1a98404a125507d33d85a0e (patch)
treee0409ebb4bec224b1231317e3e7743fb9349b989 /my_imgui_widgets.cpp
parented51dab429e467fc144f0bfbed70a5291c8a0a27 (diff)
a bit of housekeeping
Diffstat (limited to 'my_imgui_widgets.cpp')
-rw-r--r--my_imgui_widgets.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/my_imgui_widgets.cpp b/my_imgui_widgets.cpp
index ea2e314..ac0739e 100644
--- a/my_imgui_widgets.cpp
+++ b/my_imgui_widgets.cpp
@@ -111,7 +111,6 @@ static void
ImGui_DebugUndoTree(project_data *File, memory *Memory)
{
ImGui::SetNextWindowSize(ImVec2(200, 800));
- ImGui::SetNextWindowPos(ImVec2(2498, 10));
ImGui::Begin("undotree");
for (int i = 0; i < Memory->Action.NumberOfEntries; i++) {
action_entry Entry = Memory->Action.Entry[i];
@@ -802,7 +801,7 @@ ImGui_File(project_data *File, project_state *State, memory *Memory, ui *UI, ImG
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
if (State->DemoButton) {
if (ImGui::Button("Generate demo scene")) {
- // CreateDemoScene(File, Memory);
+ CreateDemoScene(File, State, Memory);
State->UpdateKeyframes = true;
State->UpdateFrame = true;
State->DemoButton = false;
@@ -885,6 +884,7 @@ ImGui_EffectsPanel(project_data *File, project_state *State, memory *Memory, ui
if (State->filter.PassFilter(EffectList[i].Name)) {
if (EffectSel == p && State->MostRecentlySelectedLayer != -1) {
AddEffect(File->Layer[State->MostRecentlySelectedLayer], Memory, i);
+ State->UpdateFrame = true;
}
p++;
}
@@ -902,6 +902,7 @@ ImGui_EffectsPanel(project_data *File, project_state *State, memory *Memory, ui
if (ImGui::IsItemClicked()) {
if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left) && State->MostRecentlySelectedLayer != -1) {
AddEffect(File->Layer[State->MostRecentlySelectedLayer], Memory, i);
+ State->UpdateFrame = true;
}
}
p++;
@@ -999,9 +1000,9 @@ ImGui_Timeline(project_data *File, project_state *State, memory *Memory, ui *UI,
UI->DraggingKeyframeThreshold += io.MouseDelta.x;
if (abs(UI->DraggingKeyframeThreshold) >= UI->TimelineZoom) {
int16 Increment = UI->DraggingKeyframeThreshold/UI->TimelineZoom;
- if (File->CurrentFrame <= 0 && Increment < File->StartFrame)
+ if (File->CurrentFrame + Increment <= 0)
File->CurrentFrame = 0;
- else if (File->CurrentFrame >= File->EndFrame && Increment > File->EndFrame) {
+ else if (File->CurrentFrame + Increment >= File->EndFrame) {
File->CurrentFrame = File->EndFrame;
} else {
File->CurrentFrame += Increment;