summaryrefslogtreecommitdiff
path: root/layer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layer.cpp')
-rw-r--r--layer.cpp46
1 files changed, 4 insertions, 42 deletions
diff --git a/layer.cpp b/layer.cpp
index b289976..1730565 100644
--- a/layer.cpp
+++ b/layer.cpp
@@ -35,45 +35,6 @@ CompUVToLayerUV(project_layer *Layer, comp_buffer *CompBuffer, v2 CompUV)
}
static void
-CalculateAnchorOffset(project_layer *, real32, uint16);
-
-static void
-InteractProperty(int16 a, project_data *File, project_state *State, bool32 Ended, real32 Value, memory *Memory)
-{
- temp_layer_list List = FindSelectedLayerIndex(File, State->NumberOfSelectedLayers);
- for (int i = 0; i < State->NumberOfSelectedLayers; i++) {
- project_layer *Layer = File->Layer[List.LayerIndex[i]];
- // keyframe *Keyframe = InsertKeyframeAtFrame(&File->LayerPTR[State->SelectedLayerIndex[r]]->Property[Index], *State, File->CurrentFrame, Memory, Cache);
- if (a == 2) {
- CalculateAnchorOffset(Layer, Value, 0);
- } else if (a == 3) {
- CalculateAnchorOffset(Layer, Value, 1);
- } else {
- Layer->Property[a].CurrentValue.f += Value;
- }
- }
- // Cache->Interact = Active;
- // 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;
- }
- State->UpdateFrame = true;
- // Cache->Frame[File->CurrentFrame].Cached = false;
-}
-
-static void
TransformsInteract(project_data *File, project_state *State, memory *Memory, ui *UI, transforms_hotkey_interact Mode)
{
if (UI->FocusedWindow == focus_timeline) {
@@ -95,13 +56,14 @@ TransformsInteract(project_data *File, project_state *State, memory *Memory, ui
} 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;
+ State->InteractCache[0] = Layer->x.CurrentValue.f;
+ State->InteractCache[1] = Layer->y.CurrentValue.f;
+ State->InteractCache[2] = Layer->ax.CurrentValue.f;
+ State->InteractCache[3] = Layer->ay.CurrentValue.f;
} else if (Mode == sliding_rotation) {
State->InteractCache[0] = Layer->rotation.CurrentValue.f;
} else if (Mode == sliding_scale) {