diff options
author | Fox Caminiti <fox@foxcam.net> | 2022-08-16 15:06:45 -0400 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2022-08-16 15:06:45 -0400 |
commit | e89dc91182a94e48ca9220a2fe075db680ddff04 (patch) | |
tree | a277c1e38293f92e635c981ad2f6b0d84d103e09 /layer.cpp | |
parent | 04b7ccfd87d802e6b9a22b86c8d098979164b8ba (diff) |
undo functional
Diffstat (limited to 'layer.cpp')
-rw-r--r-- | layer.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -56,6 +56,16 @@ InteractProperty(int16 a, project_data *File, project_state *State, bool32 Ended // Cache->InteractIndex = State->SelectedLayerIndex[0]; if (Ended) { + project_layer *Layer = File->Layer[State->MostRecentlySelectedLayer]; + // We can't end for pos/anchor point until we commit both channels. Should think of something better. + if ((a == 1) || (a == 3)) { + Action_Change_Commit(Memory, &Layer->Property[a].CurrentValue.f, &State->InteractCache[1], &Layer->Property[a].CurrentValue.f, action_change_r32); + } else { + Action_Change_Commit(Memory, &Layer->Property[a].CurrentValue.f, &State->InteractCache[0], &Layer->Property[a].CurrentValue.f, action_change_r32); + } + if (!(a == 0) && !(a == 2)) { + Action_Entry_End(Memory); + } State->IsInteracting = false; // Cache->Interact = Clear; } @@ -64,7 +74,7 @@ InteractProperty(int16 a, project_data *File, project_state *State, bool32 Ended } static void -TransformsInteract(project_data *File, project_state *State, ui *UI, transforms_hotkey_interact Mode) +TransformsInteract(project_data *File, project_state *State, memory *Memory, ui *UI, transforms_hotkey_interact Mode) { if (UI->FocusedWindow == focus_timeline) { temp_layer_list List = FindSelectedLayerIndex(File, State->NumberOfSelectedLayers); @@ -83,6 +93,20 @@ TransformsInteract(project_data *File, project_state *State, ui *UI, transforms_ } } } else if (UI->FocusedWindow == focus_viewport) { + // TODO(fox): Make multi-select possible! + project_layer *Layer = File->Layer[State->MostRecentlySelectedLayer]; + Action_Entry_Begin(Memory, action_entry_default, "Tranforms interact"); + if (Mode == sliding_position) { + State->InteractCache[0] = Layer->x.CurrentValue.f; + State->InteractCache[1] = Layer->y.CurrentValue.f; + } else if (Mode == sliding_anchorpoint) { + State->InteractCache[0] = Layer->ax.CurrentValue.f; + State->InteractCache[1] = Layer->ay.CurrentValue.f; + } else if (Mode == sliding_rotation) { + State->InteractCache[0] = Layer->rotation.CurrentValue.f; + } else if (Mode == sliding_scale) { + State->InteractCache[0] = Layer->scale.CurrentValue.f; + } State->IsInteracting = true; State->TransformsHotkeyInteract = Mode; } |