-
Notifications
You must be signed in to change notification settings - Fork 480
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
Add SDL_GetWindowBordersSize() #733
Conversation
The checks failed btw. because your travis is broken.
|
According to the documentation, this function can fail, so it should return a Why i32s? Can the borders be negative somehow? I think it would be better to have u16 or u32 instead here, if we can confirm that this never goes below 0. Otherwise LGTM. |
It will always return (0, 0, 0, 0) if it fails, so it's well defined behavior imo. |
And how do you tell the difference between a failure and a borderless window? |
Good point... Fixed, besides this function shouldn't be used for detecting a borderless window ;) |
src/sdl2/video.rs
Outdated
@@ -1167,13 +1167,17 @@ impl Window { | |||
/// | |||
/// #Notes | |||
/// If this function fails, (0, 0, 0, 0) will be returned |
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.
You forgot to change this part of the documentation.
I removed this part since it's implicit in the return type ;) |
Add SDL_GetWindowBordersSize()
Add SDL_GetWindowBordersSize() as
pub fn border_size(&self) -> (i32, i32, i32, i32)
toWindow