mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2026-11-11 04:56:44 +00:00
Refactored brushes and gradients
This commit is contained in:
1 parent
3c449b272d
commit
f7b8fe130c
10 files changed
+167
-103
No files matched your search
@@ -6,7 +6,7 @@ namespace CUE.NET.Helper
|
||||
public static class GradientHelper
|
||||
{
|
||||
// Based on https://dotupdate.wordpress.com/2008/01/28/find-the-color-of-a-point-in-a-lineargradientbrush/
|
||||
public static float CalculateGradientOffset(PointF startPoint, PointF endPoint, PointF point)
|
||||
public static float CalculateLinearGradientOffset(PointF startPoint, PointF endPoint, PointF point)
|
||||
{
|
||||
PointF intersectingPoint;
|
||||
if (startPoint.Y.Equals(endPoint.Y)) // Horizontal case
|
||||
@@ -39,7 +39,7 @@ namespace CUE.NET.Helper
|
||||
/// <summary>
|
||||
/// Returns the signed magnitude of a point on a vector
|
||||
/// </summary>
|
||||
private static float CalculateDistance(PointF point, PointF origin, PointF direction)
|
||||
public static float CalculateDistance(PointF point, PointF origin, PointF direction)
|
||||
{
|
||||
float distance = (float)Math.Sqrt((point.Y - origin.Y) * (point.Y - origin.Y) + (point.X - origin.X) * (point.X - origin.X));
|
||||
|
||||
|
||||
Reference in new issue
Block a user