diff --git a/libs/ui/source/painter_impl.cpp b/libs/ui/source/painter_impl.cpp index e3f5d78b..148035bd 100644 --- a/libs/ui/source/painter_impl.cpp +++ b/libs/ui/source/painter_impl.cpp @@ -284,10 +284,17 @@ void main() std::uint32_t const depth = impl().depth++; std::uint32_t const base = batch.vertices.size(); - batch.vertices.push_back({rect.corner(0.f, 0.f), depth, color, tc(0.f, 0.f)}); - batch.vertices.push_back({rect.corner(1.f, 0.f), depth, color, tc(1.f, 0.f)}); - batch.vertices.push_back({rect.corner(0.f, 1.f), depth, color, tc(0.f, 1.f)}); - batch.vertices.push_back({rect.corner(1.f, 1.f), depth, color, tc(1.f, 1.f)}); + auto round = [](geom::point p) + { + p[0] = std::round(p[0]); + p[1] = std::round(p[1]); + return p; + }; + + batch.vertices.push_back({round(rect.corner(0.f, 0.f)), depth, color, tc(0.f, 0.f)}); + batch.vertices.push_back({round(rect.corner(1.f, 0.f)), depth, color, tc(1.f, 0.f)}); + batch.vertices.push_back({round(rect.corner(0.f, 1.f)), depth, color, tc(0.f, 1.f)}); + batch.vertices.push_back({round(rect.corner(1.f, 1.f)), depth, color, tc(1.f, 1.f)}); batch.indices.insert(batch.indices.end(), {base + 0, base + 1, base + 2, base + 2, base + 1, base + 3}); }