GUI: Plug NinePatch bitmaps into parser

This commit is contained in:
Eugene Sandulenko 2014-05-07 13:12:59 +03:00 committed by Alexander Tkachev
parent ec7312ac13
commit 38114eb760
3 changed files with 12 additions and 4 deletions

View file

@ -469,12 +469,15 @@ bool ThemeParser::parseDrawStep(ParserNode *stepNode, Graphics::DrawStep *drawst
drawstep->blitAlphaSrc = _theme->getAlphaBitmap(stepNode->values["file"]);
if (stepNode->values.contains("autoscale"))
if (stepNode->values["autoscale"] == "true" || stepNode->values["autoscale"] == "stretch")
if (stepNode->values["autoscale"] == "true" || stepNode->values["autoscale"] == "stretch") {
drawstep->autoscale = Graphics::DrawStep::kAutoScaleStretch;
else if (stepNode->values["autoscale"] == "fit")
} else if (stepNode->values["autoscale"] == "fit") {
drawstep->autoscale = Graphics::DrawStep::kAutoScaleFit;
else
} else if (stepNode->values["autoscale"] == "9patch") {
drawstep->autoscale = Graphics::DrawStep::kAutoScaleNinePatch;
} else {
drawstep->autoscale = Graphics::DrawStep::kAutoScaleNone;
}
if (!drawstep->blitAlphaSrc)
return parserError("The given filename hasn't been loaded into the GUI.");