Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/ant/ant/antObject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
14 changes: 14 additions & 0 deletions testdata/ruby/antTest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Loading