Skip to content

Commit

Permalink
try to improve gradient freeform with rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Aytackydln committed Dec 23, 2024
1 parent f4fc4c6 commit e993a32
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,12 @@ private static double GetKeyColorPosition(PointF[] keyCorners, FreeFormObject fr

var sin = Math.Sin(freeform.Angle * Math.PI / 180);
var cos = Math.Cos(freeform.Angle * Math.PI / 180);

return x * cos - y * sin;

var keyColorPosition = x * cos - y * sin;
if (keyColorPosition < 0)
{
return 1 + keyColorPosition;
}
return keyColorPosition;
}
}

0 comments on commit e993a32

Please sign in to comment.