summaryrefslogtreecommitdiff
path: root/src/imgui_ui_properties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imgui_ui_properties.cpp')
-rw-r--r--src/imgui_ui_properties.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/imgui_ui_properties.cpp b/src/imgui_ui_properties.cpp
index 83adcf1..341045e 100644
--- a/src/imgui_ui_properties.cpp
+++ b/src/imgui_ui_properties.cpp
@@ -1,3 +1,7 @@
+#if SPECIAL
+#include "main.h"
+#endif
+
static void
ImGui_Properties_RGBASwitch(project_state *State, memory *Memory, ImGuiIO io, uint32 *Channel)
{
@@ -50,7 +54,7 @@ ImGui_Properties_CurvesUI(project_state *State, memory *Memory, ImGuiIO io, bloc
{
real32 Padding = ImGui::GetFontSize()*6;
- ImVec2 ViewportMin = ImGui::GetCursorScreenPos() + Padding/6;
+ ImVec2 ViewportMin = ImGui::GetCursorScreenPos() + ImVec2(Padding/6,Padding/6);
ImVec2 ViewportScale = ImGui::GetContentRegionAvail();
ViewportScale.y = ViewportScale.x = ViewportScale.x - Padding; // square seems nice
ImVec2 ViewportMax = ViewportMin + ViewportScale;
@@ -296,10 +300,15 @@ ImGui_PropertiesPanel(project_data *File, project_state *State, ui *UI, memory *
int h = 0, c = 0, p = 0;
property_channel *Property = NULL;
block_effect *Effect = NULL;
- while (Layer_LoopChannels(State, Memory, &InfoLocation, &ArrayLocation, Layer, &Property, &Effect, &h, &c, &p))
+ int MainProperties = AmountOf(Layer->Property);
+ // don't display time offset for shape layers
+ if (Layer->IsShapeLayer) {
+ MainProperties -= 1;
+ }
+ while (Layer_LoopChannels(State, Memory, &InfoLocation, &ArrayLocation, Layer, &Property, &Effect, &h, &c, &p, MainProperties))
{
ImGui::PushID(Property);
- if ((h - 1) < AmountOf(Layer->Property) && c == 0) {
+ if ((h - 1) < MainProperties && c == 0) {
if (ImGui::Button("K")) {
Property_AddKeyframe(Memory, F_Layers, Property, State->Frame_Current - Layer->Frame_Offset, ArrayLocation);
}
@@ -432,8 +441,19 @@ ImGui_PropertiesPanel(project_data *File, project_state *State, ui *UI, memory *
}
}
if (Layer->IsShapeLayer) {
+ shape_layer *Shape = &Layer->Shape;
shape_options *Opt = &Layer->Shape.Opt;
// TODO(fox): Combine with RGBA function?
+ ImGui::DragScalar("Shape width", ImGuiDataType_Float, &Shape->Width);
+ if (ImGui::IsItemActive()) {
+ Memory->PurgeCache = true;
+ State->UpdateFrame = true;
+ }
+ ImGui::DragScalar("Shape height ", ImGuiDataType_Float, &Shape->Height);
+ if (ImGui::IsItemActive()) {
+ Memory->PurgeCache = true;
+ State->UpdateFrame = true;
+ }
char *Names[3] = { "Fill and stroke", "Fill only", "Stroke only" };
if (ImGui::BeginListBox("Shape render type")) {
for (int i = 0; i < 3; i++) {
@@ -462,7 +482,6 @@ ImGui_PropertiesPanel(project_data *File, project_state *State, ui *UI, memory *
if (ImGui::BeginListBox("Path join type")) {
for (int i = 0; i < 2; i++) {
if (ImGui::Selectable(Names3[i], (Opt->LineJoinType == JoinVals[i]))) {
- Opt->Visibility = i;
Opt->LineJoinType = JoinVals[i];
Memory->PurgeCache = true;
State->UpdateFrame = true;