Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guapi: Why does VanillaTextFieldSkinDelegate#renderButton clone most of EditBox#renderButton? #73

Open
bluebear94 opened this issue Jan 24, 2023 · 0 comments

Comments

@bluebear94
Copy link

As I was looking into some incompatibilities between IBE Editor and Caxton, I noticed that VanillaTextFieldSkinDelegate#renderButton reimplements text field rendering instead of delegating to EditBox#renderButton. I thought that it was written that way to honor the textRendererProperty property, but given that EditBox#setFormatter is called every time that property is updated, it seems unnecessary to reimplement the method.

Similarly, mouseClicked reimplements the logic entirely instead of delegating to EditBox#mouseClicked. The reimplementation of these two methods is problematic for Caxton as they both rely on assumptions that don’t hold for complex text rendering. For that reason, Caxton mixes into EditBox#renderButton and EditBox#mouseClicked, but this does not affect the behavior of the analogous methods in VanillaTextFieldSkinDelegate.

Is there a good reason for copying the implementation of these methods rather than delegating to EditBox’s implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant