Skip to content

Commit

Permalink
| Surface.setSize(): Introduced the minimal size of one pixel instead…
Browse files Browse the repository at this point in the history
… of creating an Error Report
  • Loading branch information
Mtax-Development committed Dec 2, 2021
1 parent dfd2030 commit 64adc99
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions scripts/Surface/Surface.gml
Original file line number Diff line number Diff line change
Expand Up @@ -345,21 +345,7 @@ function Surface() constructor
}
else
{
if ((size.x > 0) and (size.y > 0))
{
surface_resize(ID, size.x, size.y);
}
else
{
var _errorReport = new ErrorReport();
var _callstack = debug_get_callstack();
var _methodName = "setSize";
var _errorText = ("Attempted to set an invalid Surface size:\n" +
"Self: " + "{" + string(self) + "}" + "\n" +
"Target size: " + "{" + string(size) + "}");
_errorReport.reportConstructorMethod(self, _callstack, _methodName,
_errorText);
}
surface_resize(ID, max(1, size.x), max(1, size.y));
}

return self;
Expand Down Expand Up @@ -772,7 +758,8 @@ function Surface() constructor
{
if ((is_struct(event))) and (is_method(event.beforeDeactivation.callback))
{
script_execute_ext(method_get_index(event.beforeDeactivation.callback),
script_execute_ext(method_get_index(event.beforeDeactivation
.callback),
((is_array(event.beforeDeactivation.argument)
? event.beforeDeactivation.argument
: [event.beforeDeactivation.argument])));
Expand Down

0 comments on commit 64adc99

Please sign in to comment.