mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-29 06:35:20 +01:00
FormSpec: 9-slice images, animated_images, and fgimg_middle (#12453)
* FormSpec: 9-slice images and animated_images * Add fgimg_middle; clean up code * Address issues, add tests * Fix stupid error; bump formspec version * Re-add image[] elements without a size
This commit is contained in:
@@ -320,15 +320,9 @@ void GUIButton::draw()
|
||||
sourceRect, &AbsoluteClippingRect,
|
||||
image_colors, UseAlphaChannel);
|
||||
} else {
|
||||
core::rect<s32> middle = BgMiddle;
|
||||
// `-x` is interpreted as `w - x`
|
||||
if (middle.LowerRightCorner.X < 0)
|
||||
middle.LowerRightCorner.X += texture->getOriginalSize().Width;
|
||||
if (middle.LowerRightCorner.Y < 0)
|
||||
middle.LowerRightCorner.Y += texture->getOriginalSize().Height;
|
||||
draw2DImage9Slice(driver, texture,
|
||||
ScaleImage ? AbsoluteRect : core::rect<s32>(pos, sourceRect.getSize()),
|
||||
middle, &AbsoluteClippingRect, image_colors);
|
||||
sourceRect, BgMiddle, &AbsoluteClippingRect, image_colors);
|
||||
}
|
||||
// END PATCH
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user