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?
As I was looking into some incompatibilities between IBE Editor and Caxton, I noticed that
VanillaTextFieldSkinDelegate#renderButton
reimplements text field rendering instead of delegating toEditBox#renderButton
. I thought that it was written that way to honor thetextRendererProperty
property, but given thatEditBox#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 toEditBox#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 intoEditBox#renderButton
andEditBox#mouseClicked
, but this does not affect the behavior of the analogous methods inVanillaTextFieldSkinDelegate
.Is there a good reason for copying the implementation of these methods rather than delegating to
EditBox
’s implementation?