From 932ee8367c7e5641b7bdcd495e7f92429c516021 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 19 Feb 2022 17:24:19 +0100 Subject: buffer flush --- atlas.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'atlas.cpp') diff --git a/atlas.cpp b/atlas.cpp index 46153629..932e8c32 100644 --- a/atlas.cpp +++ b/atlas.cpp @@ -22,11 +22,10 @@ atlas_texture::atlas_texture(const Trade::ImageData2D& image, Vector2i dims) : std::array atlas_texture::texcoords_for_id(int id_) const { CORRADE_INTERNAL_ASSERT(id_ >= 0 && id_ < dims_.product()); - constexpr Vector2 _05 = { 0.5f, 0.5f }; constexpr Vector2i _1 = { 1, 1 }; - Vector2i id = { id_ % dims_[1], id_ / dims_[1] }; - auto p0 = (Vector2(id * tile_size_) + _05) / Vector2(size_); - auto p1 = (Vector2((id + _1) * tile_size_) + _05) / Vector2(size_); + Vector2i id = { id_ % dims_[0], id_ / dims_[0] }; + auto p0 = Vector2(id * tile_size_) / Vector2(size_); + auto p1 = Vector2((id + _1) * tile_size_) / Vector2(size_); return {{ { p1[0], p1[1] }, // bottom right { p1[0], p0[1] }, // top right -- cgit v1.2.3