oωo (owo-lib)

oωo (owo-lib)

17M Downloads

[Bug] ButtonComponent force cast DrawContext to OwoUIDrawContext in**vailla** method renderWidget

zly2006 opened this issue · 2 comments

commented

This is a method inherited from vanilla, force casting it may be problematic.

@Override
public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
this.renderer.draw((OwoUIDrawContext) context, this, delta);

commented

While this is technically true, using owo-ui components outside an owo-ui component tree is (for obvious reasons) not supported. Since the DrawContext instance in an owo-ui tree will always be an OwoUIDrawContext I believe this is a fine compromise to make - besides just reimplementing buttons entirely there's not much that can be done to alleviate this otherwise

If you have any suggestions (or could maybe explain why this relevant to you) let me know, otherwise I'll go ahead and close this
Cheers

commented

OK, thanks for your explanation.