From 4474ccf8144563c4bacbb060c943c0f68e317cea Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 5 May 2014 00:52:56 +0300 Subject: GUI: Implemented alphabitmap autoscale --- gui/ThemeEngine.cpp | 2 +- gui/ThemeParser.cpp | 5 +++++ gui/ThemeParser.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'gui') diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 26729b916f..545b9b5c56 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -334,7 +334,7 @@ void ThemeItemABitmap::drawSelf(bool draw, bool restore) { _engine->restoreBackground(_area); if (draw) - _engine->renderer()->blitAlphaBitmap(_bitmap, _area); + _engine->renderer()->blitAlphaBitmap(_bitmap, _area, false); _engine->addDirtyRect(_area); } diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index 8d917f29e0..ca8b2631a5 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -468,6 +468,11 @@ bool ThemeParser::parseDrawStep(ParserNode *stepNode, Graphics::DrawStep *drawst drawstep->blitAlphaSrc = _theme->getAlphaBitmap(stepNode->values["file"]); + if (stepNode->values.contains("autoscale") && stepNode->values["autoscale"] == "true") + drawstep->autoscale = true; + else + drawstep->autoscale = false; + if (!drawstep->blitAlphaSrc) return parserError("The given filename hasn't been loaded into the GUI."); } diff --git a/gui/ThemeParser.h b/gui/ThemeParser.h index 14305af80d..155731467f 100644 --- a/gui/ThemeParser.h +++ b/gui/ThemeParser.h @@ -146,6 +146,7 @@ protected: XML_PROP(padding, false) XML_PROP(orientation, false) XML_PROP(file, false) + XML_PROP(autoscale, false) KEY_END() XML_KEY(text) -- cgit v1.2.3