Skip to content

Commit e5e055b

Browse files
committed
Remove default arguments from LuaPictureBox.*
1 parent 1fc4436 commit e5e055b

File tree

1 file changed

+59
-20
lines changed

1 file changed

+59
-20
lines changed

src/BizHawk.Client.EmuHawk/tools/Lua/LuaPictureBox.cs

Lines changed: 59 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ public void DrawBezier(LuaTable points, [LuaColorParam] object color)
8282
boxBackground.DrawBezier(GetPen(TableHelper.ParseColor(color)), pointsArr[0], pointsArr[1], pointsArr[2], pointsArr[3]);
8383
}
8484

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)
8692
{
8793
if (x < x2)
8894
{
@@ -115,7 +121,13 @@ public void DrawBox(int x, int y, int x2, int y2, [LuaColorParam] object line =
115121
}
116122
}
117123

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)
119131
{
120132
var bg = TableHelper.SafeParseColor(background) ?? _defaultBackground;
121133
var boxBackground = Graphics.FromImage(Image);
@@ -129,7 +141,7 @@ public void DrawEllipse(int x, int y, int width, int height, [LuaColorParam] obj
129141
boxBackground.DrawEllipse(GetPen(TableHelper.SafeParseColor(line) ?? _defaultForeground), x, y, width, height);
130142
}
131143

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)
133145
{
134146
Icon icon;
135147
if (width.HasValue && height.HasValue)
@@ -145,7 +157,7 @@ public void DrawIcon(string path, int x, int y, int? width = null, int? height =
145157
boxBackground.DrawIcon(icon, x, y);
146158
}
147159

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)
149161
{
150162
if (!_imageCache.TryGetValue(path, out var img))
151163
{
@@ -170,7 +182,16 @@ public void ClearImageCache()
170182
_imageCache.Clear();
171183
}
172184

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)
174195
{
175196
var img = _imageCache.GetValueOrPut(path, Image.FromFile);
176197
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
179200
boxBackground.DrawImage(img, destRect, sourceX, sourceY, sourceWidth, sourceHeight, GraphicsUnit.Pixel);
180201
}
181202

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)
183204
{
184205
var boxBackground = Graphics.FromImage(Image);
185206
boxBackground.DrawLine(GetPen(TableHelper.SafeParseColor(color) ?? _defaultForeground), x1, y1, x2, y2);
186207
}
187208

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)
189210
{
190211
var color1 = TableHelper.SafeParseColor(color);
191212
DrawLine(x + size, y, x - size, y, color1);
192213
DrawLine(x, y + size, x, y - size, color1);
193214
}
194215

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)
196224
{
197225
var boxBackground = Graphics.FromImage(Image);
198226
boxBackground.DrawArc(GetPen(TableHelper.SafeParseColor(line) ?? _defaultForeground), x, y, width, height, startAngle, sweepAngle);
@@ -205,8 +233,8 @@ public void DrawPie(
205233
int height,
206234
int startAngle,
207235
int sweepAngle,
208-
[LuaColorParam] object line = null,
209-
[LuaColorParam] object background = null)
236+
[LuaColorParam] object line,
237+
[LuaColorParam] object background)
210238
{
211239
var bg = TableHelper.SafeParseColor(background) ?? _defaultBackground;
212240
var boxBackground = Graphics.FromImage(Image);
@@ -220,13 +248,18 @@ public void DrawPie(
220248
boxBackground.DrawPie(GetPen(TableHelper.SafeParseColor(line) ?? _defaultForeground), x + 1, y + 1, width - 1, height - 1, startAngle, sweepAngle);
221249
}
222250

223-
public void DrawPixel(int x, int y, [LuaColorParam] object color = null)
251+
public void DrawPixel(int x, int y, [LuaColorParam] object color)
224252
{
225253
var boxBackground = Graphics.FromImage(Image);
226254
boxBackground.DrawLine(GetPen(TableHelper.SafeParseColor(color) ?? _defaultForeground), x, y, x + 0.1F, y);
227255
}
228256

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)
230263
{
231264
var pointsList = TableHelper.EnumerateValues<LuaTable>(points)
232265
.Select(table => TableHelper.EnumerateValues<long>(table).ToList()).ToList();
@@ -248,7 +281,13 @@ public void DrawPolygon(LuaTable points, int? x = null, int? y = null, [LuaColor
248281
}
249282
}
250283

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)
252291
{
253292
var bg = TableHelper.SafeParseColor(background) ?? _defaultBackground;
254293
var boxBackground = Graphics.FromImage(Image);
@@ -265,13 +304,13 @@ public void DrawText(
265304
int x,
266305
int y,
267306
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)
275314
{
276315
var family = FontFamily.GenericMonospace;
277316
if (fontFamily != null)

0 commit comments

Comments
 (0)