add ArdourCanvas::Flag::width()

This commit is contained in:
nick_m 2016-12-29 04:16:09 +11:00
parent cee85c34b2
commit 3129370bc5
2 changed files with 11 additions and 0 deletions

View File

@ -45,6 +45,8 @@ public:
bool covers (Duple const &) const;
double width() const;
private:
void setup (Distance height, Duple position);

View File

@ -119,3 +119,12 @@ Flag::covers (Duple const & point) const
return false;
}
double
Flag::width () const
{
boost::optional<Rect> bbox = _text->bounding_box ();
assert (bbox);
return bbox.get().width() + 10;
}