diff --git a/src/ant/ant/antObject.cc b/src/ant/ant/antObject.cc index 408f9cc57..6b23fb375 100644 --- a/src/ant/ant/antObject.cc +++ b/src/ant/ant/antObject.cc @@ -403,6 +403,25 @@ Object::box () const for (auto d = m_points.begin (); d != m_points.end (); ++d) { bx += *d; } + + if (m_outline == OL_angle) { + + double radius, start_angle, end_angle; + db::DPoint center; + if (compute_angle_parameters (radius, center, start_angle, end_angle)) { + bx += db::DBox (center - db::DVector (radius, radius), center + db::DVector (radius, radius)); + } + + } else if (m_outline == OL_radius) { + + double radius, start_angle, end_angle; + db::DPoint center; + if (compute_interpolating_circle (radius, center, start_angle, end_angle)) { + bx += db::DBox (center - db::DVector (radius, radius), center + db::DVector (radius, radius)); + } + + } + return bx; } diff --git a/testdata/ruby/antTest.rb b/testdata/ruby/antTest.rb index aededf91d..ccd56fe38 100644 --- a/testdata/ruby/antTest.rb +++ b/testdata/ruby/antTest.rb @@ -708,6 +708,20 @@ def test_6 end + # bbox + def test_7 + + a = annot_obj2( [ RBA::DPoint::new(0, 0), RBA::DPoint::new(0, 1), RBA::DPoint::new(1, 1) ], "", "", "", RBA::Annotation::StyleLine, RBA::Annotation::OutlineDiag, false, RBA::Annotation::AngleAny) + assert_equal(a.box.to_s, "(0,0;1,1)") + + a.outline = RBA::Annotation::OutlineRadius + assert_equal(a.box.to_s, "(-0.207106781187,-0.207106781187;1.20710678119,1.20710678119)") + + a.outline = RBA::Annotation::OutlineAngle + assert_equal(a.box.to_s, "(-1,0;1,2)") + + end + end load("test_epilogue.rb")