[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:
parent
84cb8913b0
commit
96371c8327
@ -51,6 +51,7 @@ public:
|
||||
void dump (std::ostream&) const;
|
||||
|
||||
std::string text() const { return _text; }
|
||||
double text_width() const;
|
||||
|
||||
private:
|
||||
std::string _text;
|
||||
|
@ -244,3 +244,14 @@ Text::dump (ostream& o) const
|
||||
|
||||
o << endl;
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
Text::text_width() const
|
||||
{
|
||||
if (_need_redraw) {
|
||||
redraw ();
|
||||
}
|
||||
|
||||
return _width;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user