diff options
Diffstat (limited to 'servers/visual/visual_server_raster.cpp')
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index dc0bff4cf4..a3aa573e35 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -6253,6 +6253,10 @@ void VisualServerRaster::_render_canvas_item(CanvasItem *p_canvas_item,const Mat sorter.sort(child_items,child_item_count); } + if (ci->z_relative) + p_z=CLAMP(p_z+ci->z,CANVAS_ITEM_Z_MIN,CANVAS_ITEM_Z_MAX); + else + p_z=ci->z; for(int i=0;i<child_item_count;i++) { @@ -6267,10 +6271,6 @@ void VisualServerRaster::_render_canvas_item(CanvasItem *p_canvas_item,const Mat ci->final_transform=xform; ci->final_opacity=opacity * ci->self_opacity; - if (ci->z_relative) - p_z=CLAMP(p_z+ci->z,CANVAS_ITEM_Z_MIN,CANVAS_ITEM_Z_MAX); - else - p_z=ci->z; int zidx = p_z-CANVAS_ITEM_Z_MIN; |