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

Bugfix: calculation of _maxDx #13

Closed

Conversation

AndrewSheetMetal
Copy link

I noticed that _maxDx was calculated quite complicated and wrong if you change properties that effect the size of the sliding button.

_maxDx = _containerWidth! -
          (sliderWidth / 2) -
          40 -
          widget.sliderButtonYOffset;

There is the hardcoded "40" and I noticed that sliderButtonYOffset (that should better be named sliderButtonXOffset ;) ) was just necessary because of a hardcoded horizontalPadding of 8 around the sliding button.

Therefore I did those changes and realized that the calculation of _maxDx becomes very simple:

_maxDx = _containerWidth! - sliderWidth;

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

Successfully merging this pull request may close these issues.

None yet

2 participants