aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/guiFormSpecMenu.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 342ef0e18..5d4ca6747 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -825,12 +825,27 @@ void GUIFormSpecMenu::parseImage(parserData* data, const std::string &element)
core::rect<s32> middle;
if (parts.size() >= 4)
parseMiddleRect(parts[3], &middle);
-
- GUIAnimatedImage *e = new GUIAnimatedImage(Environment, data->current_parent,
- spec.fid, rect);
-
- e->setTexture(texture);
- e->setMiddleRect(middle);
+
+ // Temporary fix for issue #12581 in 5.6.0.
+ // Use legacy image when not rendering 9-slice image because GUIAnimatedImage
+ // uses NNAA filter which causes visual artifacts when image uses alpha blending.
+
+ gui::IGUIElement *e;
+ if (middle.getArea() > 0) {
+ GUIAnimatedImage *image = new GUIAnimatedImage(Environment, data->current_parent,
+ spec.fid, rect);
+
+ image->setTexture(texture);
+ image->setMiddleRect(middle);
+ e = image;
+ }
+ else {
+ gui::IGUIImage *image = Environment->addImage(rect, data->current_parent, spec.fid, nullptr, true);
+ image->setImage(texture);
+ image->setScaleImage(true);
+ image->grab(); // compensate for drop in addImage
+ e = image;
+ }
auto style = getDefaultStyleForElement("image", spec.fname);
e->setNotClipped(style.getBool(StyleSpec::NOCLIP, m_formspec_version < 3));