provide ArdourCanvas::Text::{width,height}()

This commit is contained in:
Paul Davis 2016-09-27 13:46:02 -05:00
parent 78d02eb620
commit 81f2ed452b
2 changed files with 21 additions and 0 deletions

View File

@ -47,6 +47,9 @@ public:
void clamp_width (double);
double width() const;
double height() const;
void set_size_chars (int nchars);
void dump (std::ostream&) const;

View File

@ -84,6 +84,24 @@ Text::set (string const & text)
end_change ();
}
double
Text::width () const
{
if (_need_redraw) {
_redraw ();
}
return _width;
}
double
Text::height () const
{
if (_need_redraw) {
_redraw ();
}
return _height;
}
void
Text::_redraw () const
{