wisp-forest/owo-lib

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

Closed this issue · 2 comments

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);

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

OK, thanks for your explanation.