[Summary] Fixed issue when width request from Cavas text returned old width value

[Reviewed by] Paul Davis

Conflicts:
	libs/canvas/canvas/text.h
This commit is contained in:
GZharun 2014-12-15 13:17:44 +02:00 committed by Paul Davis
parent 84cb8913b0
commit 96371c8327
2 changed files with 12 additions and 0 deletions

View File

@ -51,6 +51,7 @@ public:
void dump (std::ostream&) const;
std::string text() const { return _text; }
double text_width() const;
private:
std::string _text;

View File

@ -244,3 +244,14 @@ Text::dump (ostream& o) const
o << endl;
}
double
Text::text_width() const
{
if (_need_redraw) {
redraw ();
}
return _width;
}