From f1e12e108869c560d92eb8803e4b5104c7d8f85d Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Mon, 8 Aug 2022 17:12:52 -0400 Subject: mask improvements; pen tool added --- layer.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'layer.cpp') diff --git a/layer.cpp b/layer.cpp index d6c225b..5d3a4c0 100644 --- a/layer.cpp +++ b/layer.cpp @@ -21,21 +21,17 @@ FindSelectedLayerIndex(project_data *File, int16 NumberOfSelectedLayers) static transform_info CalculateTransforms(project_layer *Layer, comp_buffer *CompBuffer); -static bool32 -TestPointInLayer(project_layer *Layer, comp_buffer *CompBuffer, v2 UV) +static v2 +CompUVToLayerUV(project_layer *Layer, comp_buffer *CompBuffer, v2 CompUV) { - bool32 Result = false; - real32 X = UV.x*CompBuffer->Width; - real32 Y = UV.y*CompBuffer->Height; + real32 X = CompUV.x*CompBuffer->Width; + real32 Y = CompUV.y*CompBuffer->Height; transform_info T = CalculateTransforms(Layer, CompBuffer); real32 StartVectorX = X - T.OriginX; real32 StartVectorY = Y - T.OriginY; real32 LayerU = (StartVectorX * T.XAxisPX) + (StartVectorY * T.XAxisPY); real32 LayerV = (StartVectorX * T.YAxisPX) + (StartVectorY * T.YAxisPY); - if (LayerU <= 1.0f && LayerU >= 0.0f && LayerV <= 1.0f && LayerV >= 0.0f) { - Result = true; - } - return Result; + return V2(LayerU, LayerV); } static void -- cgit v1.2.3