diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp index cdd20b67a7..9a0c442d8f 100644 --- a/servers/rendering/renderer_canvas_cull.cpp +++ b/servers/rendering/renderer_canvas_cull.cpp @@ -445,7 +445,7 @@ void RendererCanvasCull::_cull_canvas_item(Item *p_canvas_item, const Transform2 child_items = (Item **)alloca(child_item_count * sizeof(Item *)); ci->ysort_xform = Transform2D(); - ci->ysort_modulate = Color(1, 1, 1, 1) / ci->modulate; + ci->ysort_modulate = Color(ci->modulate[0] ? 1 / ci->modulate[0] : 0, ci->modulate[1] ? 1 / ci->modulate[1] : 0, ci->modulate[2] ? 1 / ci->modulate[2] : 0, ci->modulate[3] ? 1 / ci->modulate[3] : 0); ci->ysort_index = 0; ci->ysort_parent_abs_z_index = parent_z; child_items[0] = ci;