From 31a0f7fb0f05ee5468cfad86b1749e8b9a58b604 Mon Sep 17 00:00:00 2001 From: asheraryam Date: Sun, 28 Feb 2021 02:51:14 +0300 Subject: [PATCH] Fix rounding error in Clip Content Rounds the position and size of the final clip rect to avoid flickering issues. Fixes https://github.com/godotengine/godot/issues/46493 --- servers/visual/visual_server_canvas.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index 51bd8925e7e..cc91acfe63e 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -128,6 +128,8 @@ void VisualServerCanvas::_render_canvas_item(Item *p_canvas_item, const Transfor } else { ci->final_clip_rect = global_rect; } + ci->final_clip_rect.position = ci->final_clip_rect.position.round(); + ci->final_clip_rect.size = ci->final_clip_rect.size.round(); ci->final_clip_owner = ci; } else {