diff options
Diffstat (limited to 'src/gui/label.cpp')
-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)); } |