summaryrefslogtreecommitdiff
path: root/src/imgui_ui_viewport.cpp
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2023-03-05 13:29:14 -0500
committerFox Caminiti <fox@foxcam.net>2023-03-05 13:29:14 -0500
commitf7a194270e25deeb3ce9c9b9fbce0da8b6be71ca (patch)
tree3a9716248df5a2da58546e29c1b476c67500d621 /src/imgui_ui_viewport.cpp
parentd0410bddcd7ea43c51b6bf2442a99e58710e70eb (diff)
Diffstat (limited to 'src/imgui_ui_viewport.cpp')
-rw-r--r--src/imgui_ui_viewport.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/imgui_ui_viewport.cpp b/src/imgui_ui_viewport.cpp
index 0cfc7da..9b9942a 100644
--- a/src/imgui_ui_viewport.cpp
+++ b/src/imgui_ui_viewport.cpp
@@ -648,6 +648,8 @@ ImGui_Viewport_TransformUI2(project_data *File, project_state *State, memory *Me
// mouse's transform.
History_Entry_Commit(Memory, "Transform layers");
+ State->Interact_Transform_Prev = State->Interact_Transform;
+
interact_transform Interact = State->Interact_Transform;
v2 BoxLength = Interact.Max - Interact.Min;
v2 Center = Interact.Max - (BoxLength/2);
@@ -663,7 +665,7 @@ ImGui_Viewport_TransformUI2(project_data *File, project_state *State, memory *Me
layer_transforms T = {};
T.scale = 1.0f;
- LayerIterate(State, Memory, File->PrincipalCompIndex, T, Center, SortedCompArray, SortedLayerArray);
+ LayerIterate(State, Memory, File->PrincipalCompIndex, State->Interact_Transform, T, Center, SortedCompArray, SortedLayerArray);
History_Entry_End(Memory);
State->UpdateFrame = true;
State->UncommitedKeyframe = 1;
@@ -828,8 +830,8 @@ ImGui_Viewport_SelectedLayerUI(project_state *State, memory *Memory, ui *UI, ImG
if (State->Interact_Active != interact_type_viewport_transform_gizmo) {
if (State->Tool != tool_brush) {
ImU32 wcol2 = IM_COL32(10, 10, 10, 128);
- draw_list->AddNgon(ScreenPoint[0], 10, wcol2, 8, 9.0f);
- draw_list->AddNgon(ScreenPoint[0], 10, wcol, 8, 5.0f);
+ draw_list->AddNgonFilled(ScreenPoint[0], 5, wcol2, 6);
+ draw_list->AddNgonFilled(ScreenPoint[0], 3, wcol, 6);
}
draw_list->AddLine(ScreenPoint[1], ScreenPoint[2], wcol, 1.0f);
draw_list->AddLine(ScreenPoint[2], ScreenPoint[4], wcol, 1.0f);
@@ -901,7 +903,7 @@ ImGui_Viewport(project_data *File, project_state *State, ui *UI, memory *Memory,
Data += sizeof(gl_viewport_data);
*RenderData = { ViewportMin, ViewportMax, ImGui::GetMainViewport()->Size, State->ViewportEnabled,
Comp->Width, Comp->Height, Comp->BytesPerPixel,
- UI->CompPos, UI->CompZoom, UI->CompZoom.x / Comp->Width, {} };
+ UI->CompPos, UI->CompZoom, UI->CompZoom.x / Comp->Width, UI->BGColor, {} };
layer_transforms ExtraT = {};
Render_UI(File, State, Memory, UI, draw_list, Data, RenderData,
SortedCompArray, SortedLayerArray, ExtraT,
@@ -1307,6 +1309,8 @@ ImGui_Viewport(project_data *File, project_state *State, ui *UI, memory *Memory,
State->Interact_Offset[0] = 0;
State->Interact_Offset[1] = 0;
State->Interact_Transform = {};
+ State->Interact_Transform_Prev = {};
+ State->Interact_Transform_Prev.Position = Offset;
History_Entry_End(Memory);
} else {
Assert(IsActive);