mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
tweak time axis view item text positioning; allow ArdourCanvas::Text to have its width clamped, and use this as TAVI's get narrow so that text doesn't overflow
This commit is contained in:
parent
7e19053b88
commit
393ba98422
3 changed files with 19 additions and 10 deletions
|
|
@ -21,6 +21,7 @@ Text::Text (Group* parent)
|
|||
, _width (0)
|
||||
, _height (0)
|
||||
, _need_redraw (false)
|
||||
, _clamped_width (COORD_MAX)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -80,6 +81,12 @@ Text::redraw (Cairo::RefPtr<Cairo::Context> context) const
|
|||
_need_redraw = false;
|
||||
}
|
||||
|
||||
void
|
||||
Text::clamp_width (double w)
|
||||
{
|
||||
_clamped_width = w;
|
||||
}
|
||||
|
||||
void
|
||||
Text::compute_bounding_box () const
|
||||
{
|
||||
|
|
@ -120,7 +127,7 @@ Text::render (Rect const & /*area*/, Cairo::RefPtr<Cairo::Context> context) cons
|
|||
}
|
||||
|
||||
context->set_source (_image, 0, 0);
|
||||
context->rectangle (0, 0, _width, _height);
|
||||
context->rectangle (0, 0, min (_clamped_width, _width), _height);
|
||||
context->fill ();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue