From cdba2935a17e8fbf7b0d7ac68ffd2adf87c3c885 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Wed, 25 May 2022 10:50:15 +0100 Subject: [PATCH] Fix Occluder Poly gizmo warning spam The call to draw the handles in the OccluderPoly was spamming errors when the hole has no points. This PR prevents trying to draw the gizmo for the hole when there are no points, which prevents the spam. --- editor/spatial_editor_gizmos.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 205b5310cd3..e19f1f6a9eb 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -5398,10 +5398,14 @@ void OccluderSpatialGizmo::redraw() { const OccluderShapePolygon *occ_poly = get_occluder_shape_poly(); if (occ_poly) { // main poly - _redraw_poly(false, occ_poly->_poly_pts_local, occ_poly->_poly_pts_local_raw); + if (occ_poly->_poly_pts_local_raw.size()) { + _redraw_poly(false, occ_poly->_poly_pts_local, occ_poly->_poly_pts_local_raw); + } // hole - _redraw_poly(true, occ_poly->_hole_pts_local, occ_poly->_hole_pts_local_raw); + if (occ_poly->_hole_pts_local_raw.size()) { + _redraw_poly(true, occ_poly->_hole_pts_local, occ_poly->_hole_pts_local_raw); + } } }