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

Prevent single number widget flickering (Backport of #8291 for 3.3) #8341

Merged

Conversation

linuspahl
Copy link
Contributor

@linuspahl linuspahl commented Jun 15, 2020

This is a backport of #8291 for 3.3

As described in #7563 the single number widget can flicker when the widget has a small height.

This happened because the font size always changed between 11px and 10px. in both cases the defined tolerance did not matched. This PR is fixing the issue by increasing the tolerance. It also refactors the AutoFontSizer code style.

The issue is currently not occurring on the master branch, because #8064 changed the widget content height. You can reproduce the error, by checking out the commit ed8998c3251 and following the steps in the mentioned issue.

Fixes #7563

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

* Refactor AutoFontSizer code style

* Increase tolerance when calculating most appropriate font size

* Refactor AutoFontSizer code style

* Move module constants tolerance and child size ratio to module scope
* Create separate function to check if a font size is valid
* Add JSDoc comment for the component
* Fixing typo

* Update AutoFontSizer JSDoc comment

* Improve AutoFontSizer JSDoc comment
@dennisoelkers dennisoelkers merged commit ad147ba into 3.3 Jun 17, 2020
@dennisoelkers dennisoelkers deleted the issue-7563-fix-single-number-widget-flickering-3.3 branch June 17, 2020 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants