mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-30 16:36:57 +08:00
refactor!: Kill TextRenderer, Long Live TextRenderer (#2683)
This will:
kill the TextRenderer inheritance chain
incorporate the functionality of the base TextRenderer in the base TextFormatter
rename TextFormatter to TextRenderer and appropriate references
That is because both essentially do the same job; encompass the style (or "how") information about how to render text, but using two slightly different interfaces. While that could allow for more flexibility, it is a faux choice that needlessly complicates the pipeline. By having a single interface to comply with, we still allow for custom renders while at the same time making all the code downstream simpler to use and understand.
This commit is contained in:
@ -208,7 +208,7 @@ class MyKeyboardDetector extends HardwareKeyboardDetector
|
||||
|
||||
class KeyboardKey extends PositionComponent {
|
||||
KeyboardKey({required this.text, super.position}) {
|
||||
textElement = textRenderer.formatter.format(text);
|
||||
textElement = textRenderer.format(text);
|
||||
width = textElement.metrics.width + padding.x;
|
||||
height = textElement.metrics.height + padding.y;
|
||||
textElement.translate(
|
||||
|
||||
Reference in New Issue
Block a user