-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix game screen goes black bug #4980
Changes from 1 commit
0a6a68a
50eed2b
6367838
d8edf09
775aae9
2acf8c8
4b1305b
6fbdb21
72768a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -728,6 +728,9 @@ public int height() { | |
* @param height An integer representing the new height. | ||
*/ | ||
public void setDimensions(int width, int height) { | ||
if(width == 0 && height ==0){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor code quality fixes here, explained by the robot :-) Should this just check for an or rather than and ? In the case we're dealing with both dimensions are zero. But it seems like either being zero would be a case where you'd disregard the instruction and return early. Additionally, maybe it would be good if we did a |
||
return; | ||
} | ||
this.width = width; | ||
this.height = height; | ||
} | ||
|
@@ -737,6 +740,9 @@ public void setDimensions(int width, int height) { | |
* @param other A Dimension to use the width and height from. | ||
*/ | ||
public void setDimensions(Dimensions other) { | ||
if(width == 0 && height ==0){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In addition to my other review content in this case shouldn't we be checking |
||
return; | ||
} | ||
this.width = other.width; | ||
this.height = other.height; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's just obscuring the problem by having the method silently fail.
reproduce the issue and look at the backtrace to see where the problem is occurring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pollend That's true. I am looking for a way to solve this bug more accurately. Do you have any suggestions on where I should start on? That would be so helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the precondition should hit and give you a backtrace and give you information where this is coming from. I don't know off the top of my head why its getting set to 0,0