mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-19 05:48:07 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
33 lines
710 B
C#
33 lines
710 B
C#
namespace Editor.GraphicsItems;
|
|
|
|
public partial class RangePolygon : GraphicsItem
|
|
{
|
|
public EditableCurve CurveA { get; set; }
|
|
public EditableCurve CurveB { get; set; }
|
|
|
|
|
|
public RangePolygon( EditableCurve a, EditableCurve b ) : base( null )
|
|
{
|
|
CurveA = a;
|
|
CurveB = b;
|
|
}
|
|
|
|
protected override void OnPaint()
|
|
{
|
|
Paint.SetBrushAndPen( CurveA.CurveColor.WithAlpha( 0.2f ) );
|
|
|
|
CurveRange cr = new( CurveA.GetViewportAdjustedCurve(), CurveB.GetViewportAdjustedCurve() );
|
|
cr.DrawArea( LocalRect, 3.0f );
|
|
|
|
Paint.SetPen( CurveA.CurveColor.WithAlpha( 0.1f ), 1 );
|
|
|
|
float steps = 6;
|
|
|
|
for ( float i = 0; i <= steps; i++ )
|
|
{
|
|
cr.DrawLine( LocalRect, (1 / steps) + i / (steps + 2), 10 );
|
|
}
|
|
}
|
|
|
|
}
|