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

Allow for individual scale factor in a group #47

Open
davystrong opened this issue Jan 23, 2020 · 2 comments
Open

Allow for individual scale factor in a group #47

davystrong opened this issue Jan 23, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@davystrong
Copy link

I am having a problem were I am using two different font families that I would like to automatically resize together, so I put them both in the same group. However, one of the fonts looks smaller than the other, using the same font size.
I would like to be able to set a scale factor for one that wouldn't affect the other. Both of them would still resize at the same time but they would always maintain the same ratio.
I tried using textScaleFactor, however this doesn't seem to be independent: the second widget seems to use the same textScaleFactor as the first.

@davystrong davystrong added the enhancement New feature or request label Jan 23, 2020
@davystrong
Copy link
Author

If I modify the build function of _AutoSizeTextState like this:

if (widget.group != null) {
   widget.group._updateFontSize(this, fontSize / widget.factor);
   text =
      _buildText(widget.group._fontSize * widget.factor, style, maxLines);
}

(adding factor in the constructor), it does exactly what I want. I could work on a PR but I imagine that this overlaps with the expected functionality of textScaleFactor. Should it be changed or should a new parameter be added (if you think this is useful)?

@davystrong
Copy link
Author

davystrong commented Feb 21, 2020

I decided to create a new parameter groupScaleFactor as textScaleFactor seems to be linked to accessibility.

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

No branches or pull requests

1 participant