Closed dusk125 closed 2 months ago
Adding the maximum size could be an easy addition as well.
Adding the maximum size could be an easy addition as well.
I updated the acceptance criteria to include maximums, may as well include it as it's essentially free! Thanks
Adding the maximum size could be an easy addition as well.
I updated the acceptance criteria to include maximums, may as well include it as it's essentially free! Thanks
Yep, same func for both in go-gl/glfw so may as well stick with that https://github.com/go-gl/glfw/blob/037f3cc74f2ab0b249928c4fc4b61e0f13befdb8/v3.3/glfw/window.go#L486C18-L486C31
Are you thinking we add something like BoundLimits pixel.Rect
to WindowConfig as well?
I'm new to pixel but I don't understand why WindowConfig.Bounds
is a rect instead of only the width and height. And if you had this WindowConfig
could have a MinSize
and MaxSize
which are also vecs.
I'm new to pixel but I don't understand why
WindowConfig.Bounds
is a rect instead of only the width and height. And if you had thisWindowConfig
could have aMinSize
andMaxSize
which are also vecs.
You know.... that's a great point. At a glance window really only uses the bounds rect for width and height anyway.
Yeah +1 for using the unused x,y components for the min size!
I would do it separately. Because you have, min, max and default/initial.
I would do it separately. Because you have, min, max and default/initial.
Ahh good call
Maybe this should go on the v3 pile with color refactor? Change bounds to vec, and add min/max bound vecs.
Assuming we validate there's no reason to keep bounds as a rect
Assuming we validate there's no reason to keep bounds as a rect
The only thing I could think is we allow setting the initial window position with the x,y of the bounds, but I don't know if there's a use-case for that
There's already a WindowConfig.Pos
option... maybe in v3 we combine that into the bounds?
hmmm yeah that could work.
Also realized a useful thing about having a rect for bounds is you get win.Bounds().Center()
. Could of course add a win.Center()
if we did decide to move to a Vec, but nice to get it free with rect.
Oooo yeah good point....and I think that's why it's a rect! I mean, we could have the config option be a Vec and just convert it to a rect when the window is created
glfw has support for setting the smallest size of a resizable window with
glfwSetWindowSizeLimits
. This would add support for this function.