@@ -33,7 +33,7 @@ internal void GroupEnd()
3333 _groupControls . RemoveAt ( _groupControls . Count - 1 ) ;
3434 }
3535
36- private PointF [ ] GetBezierApproximation ( PointF [ ] controlPoints , int outputSegmentCount )
36+ public static PointF [ ] GetBezierApproximation ( PointF [ ] controlPoints , int outputSegmentCount )
3737 {
3838 PointF [ ] points = new PointF [ outputSegmentCount + 1 ] ;
3939 for ( int i = 0 ; i <= outputSegmentCount ; i ++ )
@@ -43,7 +43,7 @@ private PointF[] GetBezierApproximation(PointF[] controlPoints, int outputSegmen
4343 }
4444 return points ;
4545 }
46- private PointF GetBezierPoint ( float t , PointF [ ] controlPoints , int index , int count )
46+ private static PointF GetBezierPoint ( float t , PointF [ ] controlPoints , int index , int count )
4747 {
4848 if ( count == 1 )
4949 return controlPoints [ index ] ;
@@ -64,7 +64,7 @@ private static int GUI_SetLabelFont(Font font)
6464 else
6565 {
6666 GUI . skin . label . font = null ;
67- UnityEngine . Debug . LogWarning ( font . Name ) ;
67+ UnityEngine . Debug . Log ( font . Name ) ;
6868 }
6969 }
7070 else
@@ -102,7 +102,7 @@ public void Dispose()
102102 public void Clear ( System . Drawing . Color color )
103103 {
104104 }
105- public void DrawCurve ( Pen pen , PointF [ ] points ) // very slow.
105+ public void DrawCurve ( Pen pen , PointF [ ] points , int segments = 32 ) // very slow.
106106 {
107107 if ( points == null || points . Length <= 1 ) return ;
108108 if ( points . Length == 2 )
@@ -111,7 +111,7 @@ public void DrawCurve(Pen pen, PointF[] points) // very slow.
111111 return ;
112112 }
113113
114- var bPoints = GetBezierApproximation ( points , 32 ) ; // decrease segments for better fps.
114+ var bPoints = GetBezierApproximation ( points , segments ) ; // decrease segments for better fps.
115115 for ( int i = 0 ; i + 1 < bPoints . Length ; i ++ )
116116 DrawLine ( pen , bPoints [ i ] . X , bPoints [ i ] . Y , bPoints [ i + 1 ] . X , bPoints [ i + 1 ] . Y ) ;
117117 }
@@ -130,6 +130,11 @@ public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
130130
131131 if ( GL_Lines )
132132 {
133+ GL . PushMatrix ( ) ;
134+ if ( DefaultMaterial != null )
135+ DefaultMaterial . SetPass ( 0 ) ;
136+ GL . LoadOrtho ( ) ;
137+
133138 GL . Begin ( GL . LINES ) ;
134139 GL . Color ( pen . Color . ToUColor ( ) ) ;
135140
@@ -139,6 +144,7 @@ public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
139144 GL . Vertex3 ( x2 , y2 , 0 ) ;
140145
141146 GL . End ( ) ;
147+ GL . PopMatrix ( ) ;
142148 return ;
143149 }
144150
@@ -155,7 +161,7 @@ public void DrawLine(Pen pen, float x1, float y1, float x2, float y2)
155161 float yDiff = y2 - y1 ;
156162 var angle = Math . Atan2 ( yDiff , xDiff ) * 180.0 / Math . PI ;
157163
158- DrawTexture ( System . Windows . Forms . ApplicationBehaviour . DefaultSpriteSmoothLine , x1 , y1 , ( float ) Math . Sqrt ( xDiff * xDiff + yDiff * yDiff ) , pen . Width , pen . Color , ( float ) angle , new PointF ( ) ) ;
164+ DrawTexture ( System . Windows . Forms . ApplicationBehaviour . Resources . Reserved . Circle , x1 , y1 , ( float ) Math . Sqrt ( xDiff * xDiff + yDiff * yDiff ) , pen . Width , pen . Color , ( float ) angle , new PointF ( ) ) ;
159165 return ;
160166 }
161167
@@ -424,7 +430,7 @@ public void DrawRectangle(Pen pen, float x, float y, float width, float height)
424430 }
425431
426432
427- //UnityEngine.Debug .Log(width.ToString() + " " + height.ToString());
433+ //Application .Log(width.ToString() + " " + height.ToString());
428434 //return;
429435
430436 // Batching
0 commit comments