summaryrefslogtreecommitdiff
path: root/src/layer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/layer.cpp')
-rw-r--r--src/layer.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/layer.cpp b/src/layer.cpp
index d21ab0e..c158466 100644
--- a/src/layer.cpp
+++ b/src/layer.cpp
@@ -112,14 +112,15 @@ Layer_UpdateMasksEffects(project_state *State, block_layer *Layer, memory *Memor
if (Layer->IsShapeLayer) {
shape_layer *Shape = &Layer->Shape;
+ shape_options ShapeOpt = Layer->ShapeOpt;
void *Data = Memory_PushScratch(Memory, sizeof(nvg_point) * 128);
Arbitrary_Zero((uint8 *)Data, sizeof(nvg_point) * 128);
layer_transforms T = Layer_GetTransforms(Layer);
v2 Min = {}, Max = {};
- uint32 NumberOfVerts = NVG_FlattenPath(Memory, Shape, (nvg_point *)Data,
+ uint32 NumberOfVerts = NVG_FlattenPath(Memory, Shape, ShapeOpt, (nvg_point *)Data,
State, T, Shape->Width, Shape->Height, Width, Height, 1, &Min, &Max);
void *Data_Stroke = Memory_PushScratch(Memory, sizeof(real32) * 4 * 256);
- uint32 StrokeCount = NVG_ExpandStroke(Memory, NumberOfVerts, Shape->Opt.StrokeWidth, Shape->Opt.LineCapType, Shape->Opt.LineJoinType, Shape->IsClosed, (nvg_point *)Data, (real32 *)Data_Stroke);
+ uint32 StrokeCount = NVG_ExpandStroke(Memory, NumberOfVerts, ShapeOpt.StrokeWidth, ShapeOpt.LineCapType, ShapeOpt.LineJoinType, Shape->IsClosed, (nvg_point *)Data, (real32 *)Data_Stroke);
void *Data_Fill = Memory_PushScratch(Memory, sizeof(real32) * 4 * NumberOfVerts);
NVG_ExpandFill(Memory, NumberOfVerts, (nvg_point *)Data, (real32 *)Data_Fill);
@@ -569,11 +570,12 @@ Layer_TestBoxSelect(memory *Memory, project_state *State, ui *UI, sorted_comp_ar
nvg_point *NVGPointData = (nvg_point *)Memory_PushScratch(Memory, sizeof(nvg_point) * 1024);
v2 ShapeMin = {}, ShapeMax = {};
- uint32 NumberOfVerts = NVG_FlattenPath(Memory, Shape, NVGPointData,
+ uint32 NumberOfVerts = NVG_FlattenPath(Memory, Shape, Layer->ShapeOpt, NVGPointData,
State, T, Shape->Width, Shape->Height, Comp->Width, Comp->Height, 1, &ShapeMin, &ShapeMax);
v2 Box[4] = { MinPos, V2(MinPos.x, MaxPos.y), MaxPos, V2(MaxPos.x, MinPos.y) };
- if (Shape_TestBoxSelect(T, Comp->Width, Comp->Height, Shape->Height, Shape->Width, Box, NVGPointData, NumberOfVerts))
- Layer->IsSelected = true;
+ if (Shape_TestBoxSelect(T, Comp->Width, Comp->Height, Shape->Height, Shape->Width, Box, NVGPointData, NumberOfVerts)) {
+ Layer_Select(Memory, State, i);
+ }
Memory_PopScratch(Memory, sizeof(nvg_point) * 1024);
} else {