diff options
author | Pierre-Yves Rollo <dev@pyrollo.com> | 2020-06-24 11:35:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-24 11:35:06 +0200 |
commit | ee6c499ff8b9abf0d22ebc817a26f33322ffdd5b (patch) | |
tree | 8a4d2776277afbc70888c877a144779685a0d3d8 /src/gui/guiButton.cpp | |
parent | 646af2ef5f52cc3a04ea806d13dd2a048395da88 (diff) | |
download | hax-minetest-server-ee6c499ff8b9abf0d22ebc817a26f33322ffdd5b.tar.gz hax-minetest-server-ee6c499ff8b9abf0d22ebc817a26f33322ffdd5b.zip |
Fix wrong use of guiScalingImageButton in formspecs buttons (#10094)
Diffstat (limited to 'src/gui/guiButton.cpp')
-rw-r--r-- | src/gui/guiButton.cpp | 5 |
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);
|