diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:57:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:57:47 +0100 |
commit | 3e16c3a78fff61c20e63ba730d15e94e3bb877b4 (patch) | |
tree | c070350db219f2c4241d22bc31949685c7b42fe9 /src/gui/guiButtonImage.cpp | |
parent | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (diff) | |
parent | 6ccb5835ff55d85156be91473c598eca9d6cb9a6 (diff) | |
download | dragonfireclient-3e16c3a78fff61c20e63ba730d15e94e3bb877b4.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'src/gui/guiButtonImage.cpp')
-rw-r--r-- | src/gui/guiButtonImage.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/gui/guiButtonImage.cpp b/src/gui/guiButtonImage.cpp index 2f574c1a8..b507ffece 100644 --- a/src/gui/guiButtonImage.cpp +++ b/src/gui/guiButtonImage.cpp @@ -31,12 +31,11 @@ using namespace gui; GUIButtonImage::GUIButtonImage(gui::IGUIEnvironment *environment, gui::IGUIElement *parent, s32 id, core::rect<s32> rectangle, - ISimpleTextureSource *tsrc, bool noclip) : - GUIButton(environment, parent, id, rectangle, tsrc, noclip) + ISimpleTextureSource *tsrc, bool noclip) + : GUIButton (environment, parent, id, rectangle, tsrc, noclip) { - m_image = Environment->addImage(core::rect<s32>(0, 0, rectangle.getWidth(), - rectangle.getHeight()), - this); + m_image = Environment->addImage( + core::rect<s32>(0,0,rectangle.getWidth(),rectangle.getHeight()), this); m_image->setScaleImage(isScalingImage()); sendToBack(m_image); } @@ -57,18 +56,18 @@ void GUIButtonImage::setForegroundImage(video::ITexture *image) } //! Set element properties from a StyleSpec -void GUIButtonImage::setFromStyle(const StyleSpec &style) +void GUIButtonImage::setFromStyle(const StyleSpec& style) { GUIButton::setFromStyle(style); video::IVideoDriver *driver = Environment->getVideoDriver(); if (style.isNotDefault(StyleSpec::FGIMG)) { - video::ITexture *texture = - style.getTexture(StyleSpec::FGIMG, getTextureSource()); + video::ITexture *texture = style.getTexture(StyleSpec::FGIMG, + getTextureSource()); setForegroundImage(guiScalingImageButton(driver, texture, - AbsoluteRect.getWidth(), AbsoluteRect.getHeight())); + AbsoluteRect.getWidth(), AbsoluteRect.getHeight())); setScaleImage(true); } else { setForegroundImage(nullptr); @@ -87,8 +86,7 @@ GUIButtonImage *GUIButtonImage::addButton(IGUIEnvironment *environment, const wchar_t *tooltiptext) { GUIButtonImage *button = new GUIButtonImage(environment, - parent ? parent : environment->getRootGUIElement(), id, rectangle, - tsrc); + parent ? parent : environment->getRootGUIElement(), id, rectangle, tsrc); if (text) button->setText(text); |