-
-
Notifications
You must be signed in to change notification settings - Fork 934
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
feat: Added TextFormatter classes #1720
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just docs and an example missing otherwise it looks good!
It actually did work this time! |
Co-authored-by: Lukas Klingsbo <[email protected]>
The "basic" gesture detectors widget was creating a RawGestureDetector underneath, which resulted in two nested RawGestureDetectors, each with its own gesture arena. This refactor combines the two gesture detectors into a single one.
Since Flutter 3.0.0 we can use Melos feature for modifying the pubspec_overrides.yaml files instead of hacking around with the pubspec.lock files.
…#1726) - In Component, we will now avoid adoption queue when setting parent to the same as the current; - The ButtonComponent avoids swapping button and buttonDown components if buttonDown is null;
Since our documentation is fairly complex, we need to have a document which describes how various parts of it work. This PR adds such documentation.
…#1715) Implement drag events that dispatch using the componentsAtPoint mechanism.
* chore(release): publish packages - [email protected] * fix: flame_audio should not have upper Flutter bound
Pub gives a warning when using ^3.0.0 since that also implies less than 4.0.0, which your Flutter dependency shouldn't be. With >= it is an open range instead.
) This PR adds a getter to the FlameBlocListenable mixin. This getter will allow to use FlameBlocListenable as a standalone mixin to react to new states via onNewState(), access the current state, and also add events to the listenable Bloc via the bloc property. Currently a workaround to give components this functionality is to use FlameBlocListenable and FlameBlocReader in parallel.
…ne#1736) The return type of GameWidget docs should be Widget instead of void
My thinking was that first we develop the rich text functionality, over the course of several PRs, and only then add the proper documentation. Otherwise we'd likely have to rewrite the documentation when the rest of the pieces are developed. |
/// Helper class that stores dimensions of a single glyph for a spritesheet- | ||
/// based font. | ||
class GlyphInfo { | ||
double srcLeft = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add some dart doc on each attribute? Some of them I can infer their meaning from the name, but not all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rst*
attributes are used in the rstTransforms
argument for the canvas.drawRawAtlas
function.
We do need to have proper documentation for them, but I was thinking of leaving that for later, since we still need to merge GlyphData
and GlyphInfo
classes, plus there would be some reorganization of this class to support non-monospace fonts.
Description
TextFormatter
is a class that can take a string of text and convert it into aTextElement
.TextElement
is an object that encapsulates a text string prepared for rendering. This object knows its own dimensions (layout), and is able to render itself on a canvas.A
TextFormatter
is different from the currentTextRenderer
in one crucial respect: whereasTextRenderer
takes a string of text and draws it onto the canvas directly (performing the layout and measurement internally), theTextFormatter
creates an object that encapsulates the information necessary for rendering.Thus,
TextFormatter
's output can be used to prepare the text once, and then render multiple times. In addition, since eachTextElement
knows its own layout, -- these individual layouts can be collected, manipulated, and arranged into a larger text body necessary for rich text rendering.In addition, this PR:
TextRenderer
s to use the newTextFormatter
s under the hood.This PR is a WIP for the Rich Text functionality (#1627).
Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
.Breaking Change
Related Issues