diff options
author | Carl Hetherington <carl@carlh.net> | 2009-06-22 15:47:48 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-06-22 15:47:48 +0000 |
commit | 7b010a94aebcbf1261b183853410ebd7f0cadfb9 (patch) | |
tree | 02cbd36d1b445b08d7492daf6d5684d57c64d383 /gtk2_ardour/utils.cc | |
parent | 92f3bc5c4486bd9d26979baf60c742c95faea62e (diff) |
No-op: comments.
git-svn-id: svn://localhost/ardour2/branches/3.0@5245 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r-- | gtk2_ardour/utils.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 85bb46c6c8..7f97e88471 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -113,6 +113,13 @@ fit_to_pixels (const ustring& str, int pixel_width, Pango::FontDescription& font return txt; } +/** Try to fit a string into a given horizontal space by ellipsizing it. + * @param cr Cairo context in which the text will be plotted. + * @param name Text. + * @param avail Available horizontal space. + * @return (Text, possibly ellipsized) and (horizontal size of text) + */ + std::pair<std::string, double> fit_to_pixels (cairo_t* cr, std::string name, double avail) { |