aboutsummaryrefslogtreecommitdiff
path: root/src/gui/guiButton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/guiButton.cpp')
-rw-r--r--src/gui/guiButton.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/guiButton.cpp b/src/gui/guiButton.cpp
index ff35958fd..6732a9233 100644
--- a/src/gui/guiButton.cpp
+++ b/src/gui/guiButton.cpp
@@ -789,13 +789,12 @@ void GUIButton::setFromStyle(const StyleSpec& style)
setDrawBorder(style.getBool(StyleSpec::BORDER, true));
setUseAlphaChannel(style.getBool(StyleSpec::ALPHA, true));
- const core::position2di buttonCenter(AbsoluteRect.getCenter());
- core::position2d<s32> geom(buttonCenter);
if (style.isNotDefault(StyleSpec::BGIMG)) {
video::ITexture *texture = style.getTexture(StyleSpec::BGIMG,
getTextureSource());
setImage(guiScalingImageButton(
- Environment->getVideoDriver(), texture, geom.X, geom.Y));
+ Environment->getVideoDriver(), texture,
+ AbsoluteRect.getWidth(), AbsoluteRect.getHeight()));
setScaleImage(true);
} else {
setImage(nullptr);