forked from Mirrorlandia_minetest/minetest
Use legacy image implementation (no NNAA filter) when not using 9-slice image (#12608)
This commit is contained in:
parent
a2bf3a2aa8
commit
839600ed70
@ -825,12 +825,27 @@ void GUIFormSpecMenu::parseImage(parserData* data, const std::string &element)
|
|||||||
core::rect<s32> middle;
|
core::rect<s32> middle;
|
||||||
if (parts.size() >= 4)
|
if (parts.size() >= 4)
|
||||||
parseMiddleRect(parts[3], &middle);
|
parseMiddleRect(parts[3], &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.
|
||||||
|
|
||||||
GUIAnimatedImage *e = new GUIAnimatedImage(Environment, data->current_parent,
|
gui::IGUIElement *e;
|
||||||
spec.fid, rect);
|
if (middle.getArea() > 0) {
|
||||||
|
GUIAnimatedImage *image = new GUIAnimatedImage(Environment, data->current_parent,
|
||||||
|
spec.fid, rect);
|
||||||
|
|
||||||
e->setTexture(texture);
|
image->setTexture(texture);
|
||||||
e->setMiddleRect(middle);
|
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);
|
auto style = getDefaultStyleForElement("image", spec.fname);
|
||||||
e->setNotClipped(style.getBool(StyleSpec::NOCLIP, m_formspec_version < 3));
|
e->setNotClipped(style.getBool(StyleSpec::NOCLIP, m_formspec_version < 3));
|
||||||
|
Loading…
Reference in New Issue
Block a user