Merge pull request #19671 from kadet1090/placement-indicator
Gui: Add Show Placement helper
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -42,7 +42,7 @@ class PartGuiExport ViewProvider2DObject : public PartGui::ViewProviderPart
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(PartGui::ViewProvider2DObject);
|
||||
|
||||
static constexpr float horizontalPlanePadding = 8;
|
||||
static constexpr float verticalPlanePadding = 5;
|
||||
static constexpr float verticalPlanePadding = 6;
|
||||
|
||||
public:
|
||||
/// constructor
|
||||
|
||||
Reference in New Issue
Block a user