Add XCUI native image UV support

This commit is contained in:
2026-04-05 14:16:53 +08:00
parent daa54e0230
commit 231df6ee36
6 changed files with 68 additions and 18 deletions

View File

@@ -39,6 +39,8 @@ struct UIDrawCommand {
UIDrawCommandType type = UIDrawCommandType::FilledRect;
UIRect rect = {};
UIPoint position = {};
UIPoint uvMin = {};
UIPoint uvMax = UIPoint(1.0f, 1.0f);
UIColor color = {};
float thickness = 1.0f;
float rounding = 0.0f;
@@ -122,12 +124,16 @@ public:
UIDrawCommand& AddImage(
const UIRect& rect,
const UITextureHandle& texture,
const UIColor& tintColor = {}) {
const UIColor& tintColor = {},
const UIPoint& uvMin = {},
const UIPoint& uvMax = UIPoint(1.0f, 1.0f)) {
UIDrawCommand command = {};
command.type = UIDrawCommandType::Image;
command.rect = rect;
command.texture = texture;
command.color = tintColor;
command.uvMin = uvMin;
command.uvMax = uvMax;
return AddCommand(std::move(command));
}