aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/menu/text.cpp')
-rw-r--r--src/menu/text.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/menu/text.cpp b/src/menu/text.cpp
index 39df2e06..884809c9 100644
--- a/src/menu/text.cpp
+++ b/src/menu/text.cpp
@@ -62,9 +62,16 @@ namespace usdx
}
}
+ Rectangle<int> Text::makeRect(const FTBBox& bbox)
+ {
+ return Rectangle<int>(Point<int>(bbox.Upper().X(), bbox.Upper().Y()),
+ Point<int>(bbox.Lower().X(), bbox.Lower().Y()));
+ }
+
+
void Text::realign(void)
{
- Rectangle<int> bbox(font->BBox(text.c_str()));
+ Rectangle<int> bbox = makeRect(font->BBox(text.c_str()));
bbox.get_point1().set_y(font->Ascender());
bbox.get_point2().set_y(font->Descender());
valign->align(offset, bbox, get_size());