Gui: Fix empty sketch plane rendering

This commit is contained in:
Kacper Donat
2025-02-15 16:42:43 +01:00
parent 41f09db9e1
commit 62432046bf
3 changed files with 13 additions and 1 deletions

View File

@@ -396,6 +396,12 @@ void ViewProvider2DObject::updatePlane()
Base::ViewOrthoProjMatrix proj(place.inverse().toMatrix());
Base::BoundBox2d bb = bbox.ProjectBox(&proj);
// when projection of invalid it often results in infinite shapes
// if that happens we simply use some small bounding box to mark plane
if (bb.IsInfinite() || !bb.IsValid()) {
bb = Base::BoundBox2d(-1, -1, 1, 1);
}
SbVec3f verts[4] = {
SbVec3f(bb.MinX - horizontalPlanePadding, bb.MinY - verticalPlanePadding, 0),
SbVec3f(bb.MinX - horizontalPlanePadding, bb.MaxY + verticalPlanePadding, 0),