summaryrefslogtreecommitdiff
path: root/src/imgui_ui.cpp
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2023-01-23 23:57:37 -0500
committerFox Caminiti <fox@foxcam.net>2023-01-23 23:57:37 -0500
commite4acc91f56d9d88b75f60a23bd9662804d7c54b7 (patch)
treee0a30356d078557cf18417082dc0122c6fd4c171 /src/imgui_ui.cpp
parent6298837d4b5fbff561e3d7e6a3361bd64e432960 (diff)
selection upgrade wip
Diffstat (limited to 'src/imgui_ui.cpp')
-rw-r--r--src/imgui_ui.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/imgui_ui.cpp b/src/imgui_ui.cpp
index 380aaf2..bfb79f3 100644
--- a/src/imgui_ui.cpp
+++ b/src/imgui_ui.cpp
@@ -387,6 +387,26 @@ ImGui_ProcessInputs(project_data *File, project_state *State, ui *UI, memory *Me
State->Interact_Modifier = 1;
else
State->Interact_Modifier = 0;
+ } else if (io.KeyShift) {
+ bool32 CommitAction = 0;
+ int h = 0, c = 0, i = 0;
+ while (Block_Loop(Memory, F_Layers, File->Layer_Count, &h, &c, &i)) {
+ block_layer *Layer = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, i);
+ if (Layer->IsSelected && Layer->IsShapeLayer) {
+ if (!CommitAction) {
+ History_Entry_Commit(Memory, "Swap shape colors");
+ CommitAction = 1;
+ }
+ v4 Temp = Layer->ShapeOpt.FillCol;
+ History_Action_Swap(Memory, F_Layers, sizeof(Layer->ShapeOpt.FillCol), &Layer->ShapeOpt.FillCol);
+ Layer->ShapeOpt.FillCol = Layer->ShapeOpt.StrokeCol;
+ History_Action_Swap(Memory, F_Layers, sizeof(Layer->ShapeOpt.StrokeCol), &Layer->ShapeOpt.StrokeCol);
+ Layer->ShapeOpt.StrokeCol = Temp;
+ }
+ }
+ if (CommitAction) {
+ History_Entry_End(Memory);
+ }
} else {
v4 Temp = UI->Color;
UI->Color = UI->AltColor;