diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-02-06 21:26:24 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-02-07 21:11:34 +0100 |
commit | 812fc04430cfd3863f5bce2319deef26e5d3c316 (patch) | |
tree | ef44383ce06cf3b47ced36f9c6238e892659be07 /src/gui/widgets/browserbox.h | |
parent | 04a3cdd669726389b3b10c5d2da5440262e3765d (diff) | |
download | mana-812fc04430cfd3863f5bce2319deef26e5d3c316.tar.gz mana-812fc04430cfd3863f5bce2319deef26e5d3c316.tar.bz2 mana-812fc04430cfd3863f5bce2319deef26e5d3c316.tar.xz mana-812fc04430cfd3863f5bce2319deef26e5d3c316.zip |
Made BrowserBox use the recommended line skip for its font
SDL_ttf provides a separate function for getting the recommended line skip, or
the spacing between two lines of text. When rendering multiple lines of text
this should be used rather than the visual height of the font.
Since the information is only available for TrueTypeFont, a dynamic_cast was
used with a fallback on gcn::Font::getHeight.
Also made some small tweaks but nothing that really affects performance.
Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/gui/widgets/browserbox.h')
-rw-r--r-- | src/gui/widgets/browserbox.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h index 877442d6..ecdf8ca7 100644 --- a/src/gui/widgets/browserbox.h +++ b/src/gui/widgets/browserbox.h @@ -31,7 +31,7 @@ class LinkHandler; -struct BROWSER_LINK +struct BrowserLink { int x1, x2, y1, y2; /**< Where link is placed */ std::string link; @@ -104,7 +104,7 @@ class BrowserBox : public gcn::Widget, /** * Sets the maximum numbers of rows in the browser box. 0 = no limit. */ - void setMaxRow(unsigned max) {mMaxRows = max; }; + void setMaxRow(unsigned max) {mMaxRows = max; } /** * Disable links & user defined colors to be used in chat input. @@ -200,7 +200,7 @@ class BrowserBox : public gcn::Widget, typedef LinePartList::iterator LinePartIterator; LinePartList mLineParts; - typedef std::vector<BROWSER_LINK> Links; + typedef std::vector<BrowserLink> Links; typedef Links::iterator LinkIterator; Links mLinks; |