diff options
author | Ira Rice <irarice@gmail.com> | 2009-03-19 20:55:42 -0600 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-19 20:55:42 -0600 |
commit | c2c0a9fa8476b9335a6198b41cc702da82fd40bd (patch) | |
tree | e9fdaaa8f2056b1e79c3f7ad83520cc0817815e6 /src/gui | |
parent | 5022aad7e787777e6fd3e8e34956e53aabb41c21 (diff) | |
download | mana-c2c0a9fa8476b9335a6198b41cc702da82fd40bd.tar.gz mana-c2c0a9fa8476b9335a6198b41cc702da82fd40bd.tar.bz2 mana-c2c0a9fa8476b9335a6198b41cc702da82fd40bd.tar.xz mana-c2c0a9fa8476b9335a6198b41cc702da82fd40bd.zip |
Reduced down label code.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/label.cpp | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/src/gui/label.cpp b/src/gui/label.cpp index bab8c465..e8d72ace 100644 --- a/src/gui/label.cpp +++ b/src/gui/label.cpp @@ -20,16 +20,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include <guichan/exception.hpp> -#include <guichan/font.hpp> - -#include "gui.h" #include "label.h" #include "palette.h" -#include "../graphics.h" - Label::Label() : gcn::Label() { @@ -42,27 +35,6 @@ Label::Label(const std::string& caption) : void Label::draw(gcn::Graphics* graphics) { - int textX; - int textY = getHeight() / 2 - getFont()->getHeight() / 2; - - switch (getAlignment()) - { - case gcn::Graphics::LEFT: - textX = 0; - break; - case gcn::Graphics::CENTER: - textX = getWidth() / 2; - break; - case gcn::Graphics::RIGHT: - textX = getWidth(); - break; - default: - throw GCN_EXCEPTION("Unknown alignment."); - } - setForegroundColor(guiPalette->getColor(Palette::TEXT)); - - graphics->setFont(getFont()); - graphics->setColor(getForegroundColor()); - graphics->drawText(getCaption(), textX, textY, getAlignment()); + gcn::Label::draw(static_cast<gcn::Graphics*>(graphics)); } |