@@ -82,7 +82,13 @@ public void DrawBezier(LuaTable points, [LuaColorParam] object color)
82
82
boxBackground . DrawBezier ( GetPen ( TableHelper . ParseColor ( color ) ) , pointsArr [ 0 ] , pointsArr [ 1 ] , pointsArr [ 2 ] , pointsArr [ 3 ] ) ;
83
83
}
84
84
85
- public void DrawBox ( int x , int y , int x2 , int y2 , [ LuaColorParam ] object line = null , [ LuaColorParam ] object background = null )
85
+ public void DrawBox (
86
+ int x ,
87
+ int y ,
88
+ int x2 ,
89
+ int y2 ,
90
+ [ LuaColorParam ] object line ,
91
+ [ LuaColorParam ] object background )
86
92
{
87
93
if ( x < x2 )
88
94
{
@@ -115,7 +121,13 @@ public void DrawBox(int x, int y, int x2, int y2, [LuaColorParam] object line =
115
121
}
116
122
}
117
123
118
- public void DrawEllipse ( int x , int y , int width , int height , [ LuaColorParam ] object line = null , [ LuaColorParam ] object background = null )
124
+ public void DrawEllipse (
125
+ int x ,
126
+ int y ,
127
+ int width ,
128
+ int height ,
129
+ [ LuaColorParam ] object line ,
130
+ [ LuaColorParam ] object background )
119
131
{
120
132
var bg = TableHelper . SafeParseColor ( background ) ?? _defaultBackground ;
121
133
var boxBackground = Graphics . FromImage ( Image ) ;
@@ -129,7 +141,7 @@ public void DrawEllipse(int x, int y, int width, int height, [LuaColorParam] obj
129
141
boxBackground . DrawEllipse ( GetPen ( TableHelper . SafeParseColor ( line ) ?? _defaultForeground ) , x , y , width , height ) ;
130
142
}
131
143
132
- public void DrawIcon ( string path , int x , int y , int ? width = null , int ? height = null )
144
+ public void DrawIcon ( string path , int x , int y , int ? width , int ? height )
133
145
{
134
146
Icon icon ;
135
147
if ( width . HasValue && height . HasValue )
@@ -145,7 +157,7 @@ public void DrawIcon(string path, int x, int y, int? width = null, int? height =
145
157
boxBackground . DrawIcon ( icon , x , y ) ;
146
158
}
147
159
148
- public void DrawImage ( string path , int x , int y , int ? width = null , int ? height = null , bool cache = true )
160
+ public void DrawImage ( string path , int x , int y , int ? width , int ? height , bool cache )
149
161
{
150
162
if ( ! _imageCache . TryGetValue ( path , out var img ) )
151
163
{
@@ -170,7 +182,16 @@ public void ClearImageCache()
170
182
_imageCache . Clear ( ) ;
171
183
}
172
184
173
- public void DrawImageRegion ( string path , int sourceX , int sourceY , int sourceWidth , int sourceHeight , int destX , int destY , int ? destWidth = null , int ? destHeight = null )
185
+ public void DrawImageRegion (
186
+ string path ,
187
+ int sourceX ,
188
+ int sourceY ,
189
+ int sourceWidth ,
190
+ int sourceHeight ,
191
+ int destX ,
192
+ int destY ,
193
+ int ? destWidth ,
194
+ int ? destHeight )
174
195
{
175
196
var img = _imageCache . GetValueOrPut ( path , Image . FromFile ) ;
176
197
var destRect = new Rectangle ( destX , destY , destWidth ?? sourceWidth , destHeight ?? sourceHeight ) ;
@@ -179,20 +200,27 @@ public void DrawImageRegion(string path, int sourceX, int sourceY, int sourceWid
179
200
boxBackground . DrawImage ( img , destRect , sourceX , sourceY , sourceWidth , sourceHeight , GraphicsUnit . Pixel ) ;
180
201
}
181
202
182
- public void DrawLine ( int x1 , int y1 , int x2 , int y2 , [ LuaColorParam ] object color = null )
203
+ public void DrawLine ( int x1 , int y1 , int x2 , int y2 , [ LuaColorParam ] object color )
183
204
{
184
205
var boxBackground = Graphics . FromImage ( Image ) ;
185
206
boxBackground . DrawLine ( GetPen ( TableHelper . SafeParseColor ( color ) ?? _defaultForeground ) , x1 , y1 , x2 , y2 ) ;
186
207
}
187
208
188
- public void DrawAxis ( int x , int y , int size , [ LuaColorParam ] object color = null )
209
+ public void DrawAxis ( int x , int y , int size , [ LuaColorParam ] object color )
189
210
{
190
211
var color1 = TableHelper . SafeParseColor ( color ) ;
191
212
DrawLine ( x + size , y , x - size , y , color1 ) ;
192
213
DrawLine ( x , y + size , x , y - size , color1 ) ;
193
214
}
194
215
195
- public void DrawArc ( int x , int y , int width , int height , int startAngle , int sweepAngle , [ LuaColorParam ] object line = null )
216
+ public void DrawArc (
217
+ int x ,
218
+ int y ,
219
+ int width ,
220
+ int height ,
221
+ int startAngle ,
222
+ int sweepAngle ,
223
+ [ LuaColorParam ] object line )
196
224
{
197
225
var boxBackground = Graphics . FromImage ( Image ) ;
198
226
boxBackground . DrawArc ( GetPen ( TableHelper . SafeParseColor ( line ) ?? _defaultForeground ) , x , y , width , height , startAngle , sweepAngle ) ;
@@ -205,8 +233,8 @@ public void DrawPie(
205
233
int height ,
206
234
int startAngle ,
207
235
int sweepAngle ,
208
- [ LuaColorParam ] object line = null ,
209
- [ LuaColorParam ] object background = null )
236
+ [ LuaColorParam ] object line ,
237
+ [ LuaColorParam ] object background )
210
238
{
211
239
var bg = TableHelper . SafeParseColor ( background ) ?? _defaultBackground ;
212
240
var boxBackground = Graphics . FromImage ( Image ) ;
@@ -220,13 +248,18 @@ public void DrawPie(
220
248
boxBackground . DrawPie ( GetPen ( TableHelper . SafeParseColor ( line ) ?? _defaultForeground ) , x + 1 , y + 1 , width - 1 , height - 1 , startAngle , sweepAngle ) ;
221
249
}
222
250
223
- public void DrawPixel ( int x , int y , [ LuaColorParam ] object color = null )
251
+ public void DrawPixel ( int x , int y , [ LuaColorParam ] object color )
224
252
{
225
253
var boxBackground = Graphics . FromImage ( Image ) ;
226
254
boxBackground . DrawLine ( GetPen ( TableHelper . SafeParseColor ( color ) ?? _defaultForeground ) , x , y , x + 0.1F , y ) ;
227
255
}
228
256
229
- public void DrawPolygon ( LuaTable points , int ? x = null , int ? y = null , [ LuaColorParam ] object line = null , [ LuaColorParam ] object background = null )
257
+ public void DrawPolygon (
258
+ LuaTable points ,
259
+ int ? x ,
260
+ int ? y ,
261
+ [ LuaColorParam ] object line ,
262
+ [ LuaColorParam ] object background )
230
263
{
231
264
var pointsList = TableHelper . EnumerateValues < LuaTable > ( points )
232
265
. Select ( table => TableHelper . EnumerateValues < long > ( table ) . ToList ( ) ) . ToList ( ) ;
@@ -248,7 +281,13 @@ public void DrawPolygon(LuaTable points, int? x = null, int? y = null, [LuaColor
248
281
}
249
282
}
250
283
251
- public void DrawRectangle ( int x , int y , int width , int height , [ LuaColorParam ] object line = null , [ LuaColorParam ] object background = null )
284
+ public void DrawRectangle (
285
+ int x ,
286
+ int y ,
287
+ int width ,
288
+ int height ,
289
+ [ LuaColorParam ] object line ,
290
+ [ LuaColorParam ] object background )
252
291
{
253
292
var bg = TableHelper . SafeParseColor ( background ) ?? _defaultBackground ;
254
293
var boxBackground = Graphics . FromImage ( Image ) ;
@@ -265,13 +304,13 @@ public void DrawText(
265
304
int x ,
266
305
int y ,
267
306
string message ,
268
- [ LuaColorParam ] object foreColor = null ,
269
- [ LuaColorParam ] object backColor = null ,
270
- int ? fontSize = null ,
271
- string fontFamily = null ,
272
- string fontStyle = null ,
273
- string horizAlign = null ,
274
- string vertAlign = null )
307
+ [ LuaColorParam ] object foreColor ,
308
+ [ LuaColorParam ] object backColor ,
309
+ int ? fontSize ,
310
+ string fontFamily ,
311
+ string fontStyle ,
312
+ string horizAlign ,
313
+ string vertAlign )
275
314
{
276
315
var family = FontFamily . GenericMonospace ;
277
316
if ( fontFamily != null )
0 commit comments