make computation of OS X pango text width correction less intrusive/more efficient.

Compute the correction only once after each font specification setting.
This commit is contained in:
Paul Davis 2014-09-19 13:17:45 -04:00
parent 5fe0c4be63
commit 75a150ecc0
2 changed files with 27 additions and 24 deletions

View file

@ -52,8 +52,6 @@ public:
double text_width() const { return _width; }
private:
double _width_correction;
std::string _text;
uint32_t _color;
Pango::FontDescription* _font_description;
@ -63,6 +61,7 @@ private:
mutable double _width;
mutable double _height;
mutable bool _need_redraw;
mutable double _width_correction;
double _clamped_width;
void redraw (Cairo::RefPtr<Cairo::Context>) const;