Consider exposing window size from Graphics2D
matklad opened this issue · comments
Alex Kladov commented
When drawing onto a resizable window, it's useful to know the current window size. Right now, I get it by storing the current size in my Handler and updating it on on_draw
, but it would perhaps be more natural to have something like
impl Graphics2D {
fn size(&self) -> Vec2;
}
Just so that one doesn't need to think about converting between integral pixels and float coordinates graphics is using for most stuff.
Dennis commented
Would #78 be a solution? It's not attached directly to Graphics2D but to the WindowHelper that gets passed with the draw() methods
Alex Kladov commented
Yup!
QuantumBadger commented
Now merged, thank you @dennisorlando!