diff options
author | Fox Caminiti <fox@foxcam.net> | 2022-08-08 17:12:52 -0400 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2022-08-08 17:12:52 -0400 |
commit | f1e12e108869c560d92eb8803e4b5104c7d8f85d (patch) | |
tree | 5daf3348b04574cb2008cffc7fa76195218fc4ea /layer.cpp | |
parent | 635576972024319c15141645d3304db8cd1d1e19 (diff) |
mask improvements; pen tool added
Diffstat (limited to 'layer.cpp')
-rw-r--r-- | layer.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -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 |