Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant