diff options
author | GZharun <grygoriiz@wavesglobal.com> | 2014-12-15 13:17:44 +0200 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-04-29 07:27:34 -0400 |
commit | 96371c83277f4618138264302c7ea62e017f4a82 (patch) | |
tree | ebdb1c6879a7e1c026f55300282f4c6325c18cfa /libs | |
parent | 84cb8913b080df9d6dde2ebc478bdb59316b4a1d (diff) |
[Summary] Fixed issue when width request from Cavas text returned old width value
[Reviewed by] Paul Davis
Conflicts:
libs/canvas/canvas/text.h
Diffstat (limited to 'libs')
-rw-r--r-- | libs/canvas/canvas/text.h | 1 | ||||
-rw-r--r-- | libs/canvas/text.cc | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/libs/canvas/canvas/text.h b/libs/canvas/canvas/text.h index a967206e65..ee22a3ecda 100644 --- a/libs/canvas/canvas/text.h +++ b/libs/canvas/canvas/text.h @@ -51,6 +51,7 @@ public: void dump (std::ostream&) const; std::string text() const { return _text; } + double text_width() const; private: std::string _text; diff --git a/libs/canvas/text.cc b/libs/canvas/text.cc index c1b1c517c8..86d8aa9136 100644 --- a/libs/canvas/text.cc +++ b/libs/canvas/text.cc @@ -244,3 +244,14 @@ Text::dump (ostream& o) const o << endl; } + + +double +Text::text_width() const +{ + if (_need_redraw) { + redraw (); + } + + return _width; +} |