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
This commit is contained in:
asheraryam 2021-02-28 02:51:14 +03:00
parent 8385a0d8ad
commit 31a0f7fb0f

View file

@ -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 {