diff options
author | Fox Caminiti <fox@foxcam.net> | 2023-01-06 23:11:49 -0500 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2023-01-06 23:11:49 -0500 |
commit | 1d0d8549411e23394059f420f053cc3ee28dacfb (patch) | |
tree | c4486e5632c09d11acfae5634dceb3db6d6dba97 /src/layer.cpp | |
parent | 84d04d391bc4bf9481106d4f5ac4d3dd8f27ed87 (diff) |
more shape code
Diffstat (limited to 'src/layer.cpp')
-rw-r--r-- | src/layer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/layer.cpp b/src/layer.cpp index 6159467..b27935b 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -112,11 +112,14 @@ Layer_UpdateMasksEffects(project_state *State, block_layer *Layer, memory *Memor Arbitrary_Zero((uint8 *)Data, sizeof(nvg_point) * 128); layer_transforms T = Layer_GetTransforms(Layer); v2 Min = {}, Max = {}; + int ShapeWidth = 0, ShapeHeight = 0; if (State->Interact_Active == interact_type_keyframe_move) { NVG_FlattenPath(Memory, Shape, (nvg_point *)Data, State, T, 0, 0, Width, Height, 0, &Min, &Max); + ShapeWidth = Max.x - Min.x; + ShapeHeight = Max.y - Min.y; } uint32 NumberOfVerts = NVG_FlattenPath(Memory, Shape, (nvg_point *)Data, - State, T, Shape->Width, Shape->Height, Width, Height, 1, &Min, &Max); + State, T, ShapeWidth, ShapeHeight, 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); void *Data_Fill = Memory_PushScratch(Memory, sizeof(real32) * 4 * NumberOfVerts); |