From 321b394c397f826dbbda6e617aece10e732daadc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 24 Feb 2023 10:54:58 +0100 Subject: fix (?) wrong global_coords unsigned offset --- main/draw.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'main') diff --git a/main/draw.cpp b/main/draw.cpp index 1cb9b396..81dd7172 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -52,11 +52,16 @@ auto main_impl::get_draw_bounds() const noexcept -> draw_bounds using limits = std::numeric_limits; auto x0 = limits::max(), x1 = limits::min(), y0 = limits::max(), y1 = limits::min(); - for (const auto win = Vector2d(framebufferSize()); - auto p : {pixel_to_tile(Vector2d{0, 0}).chunk(), - pixel_to_tile(Vector2d{win[0]-1, 0}).chunk(), - pixel_to_tile(Vector2d{0, win[1]-1}).chunk(), - pixel_to_tile(Vector2d{win[0]-1, win[1]-1}).chunk()}) + const auto win = Vector2d(framebufferSize()); + + chunk_coords list[] = { + pixel_to_tile(Vector2d{0, 0}).chunk(), + pixel_to_tile(Vector2d{win[0]-1, 0}).chunk(), + pixel_to_tile(Vector2d{0, win[1]-1}).chunk(), + pixel_to_tile(Vector2d{win[0]-1, win[1]-1}).chunk(), + }; + + for (auto p : list) { x0 = std::min(x0, p.x); x1 = std::max(x1, p.x); -- cgit v1.2.3