From c29324997eeef84db7f20261c0ebdce421e099f1 Mon Sep 17 00:00:00 2001 From: codefactor-io Date: Thu, 8 Jan 2026 07:48:22 +0000 Subject: [PATCH] [CodeFactor] Apply fixes --- AddShapeEffect/AddShapeEffectProcessor.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/AddShapeEffect/AddShapeEffectProcessor.cs b/AddShapeEffect/AddShapeEffectProcessor.cs index d599bdc..a1fab78 100644 --- a/AddShapeEffect/AddShapeEffectProcessor.cs +++ b/AddShapeEffect/AddShapeEffectProcessor.cs @@ -1,4 +1,4 @@ -using System.Collections.Immutable; +using System.Collections.Immutable; using System.Numerics; using AddShapeEffect.ForVideoEffectChain; using Vortice.Direct2D1; @@ -73,7 +73,6 @@ public DrawDescription Update(EffectDescription effectDescription) DrawDescription descAfterChain = effectDescription.DrawDescription; if (currentInput == null) return effectDescription.DrawDescription; - { var shapeParameter = item.ShapeParameter; if (isFirst || this.shapeParameter != shapeParameter) @@ -129,8 +128,8 @@ public DrawDescription Update(EffectDescription effectDescription) float baseL = x - baseHalfWidth; float baseR = x + baseHalfWidth; - float targetL = item.PinLeft ? (-inputWidth / 2f + leftMargin) : baseL; - float targetR = item.PinRight ? (inputWidth / 2f - rightMargin) : baseR; + float targetL = item.PinLeft ? ((-inputWidth / 2f) + leftMargin) : baseL; + float targetR = item.PinRight ? ((inputWidth / 2f) - rightMargin) : baseR; float finalWidth = targetR - targetL; float finalScaleX = (shapeWidth > 0) ? (finalWidth / shapeWidth) : 0; @@ -140,8 +139,8 @@ public DrawDescription Update(EffectDescription effectDescription) float baseT = y - baseHalfHeight; float baseB = y + baseHalfHeight; - float targetT = item.PinTop ? (-inputHeight / 2f + topMargin) : baseT; - float targetB = item.PinBottom ? (inputHeight / 2f - bottomMargin) : baseB; + float targetT = item.PinTop ? ((-inputHeight / 2f) + topMargin) : baseT; + float targetB = item.PinBottom ? ((inputHeight / 2f) - bottomMargin) : baseB; float finalHeight = targetB - targetT; float finalScaleY = (shapeHeight > 0) ? (finalHeight / shapeHeight) : 0;