summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasheraryam <asheraryam@gmail.com>2021-03-02 18:36:28 +0300
committerasheraryam <asheraryam@gmail.com>2021-03-02 18:36:28 +0300
commitc3d8538bb42f58aed598e361aa23fb1f6fd3d01a (patch)
tree1b9b2319d4cd29001dd9c7f0e100211c50b8358f
parent8faecd6a470aeef41084a32d74f4a131a5ef42b6 (diff)
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
-rw-r--r--servers/rendering/renderer_canvas_cull.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp
index e34bc9acb8..081154aa1d 100644
--- a/servers/rendering/renderer_canvas_cull.cpp
+++ b/servers/rendering/renderer_canvas_cull.cpp
@@ -148,6 +148,8 @@ void RendererCanvasCull::_cull_canvas_item(Item *p_canvas_item, const Transform2
} 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 {