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

Fix initial padding and startPosition when scrolling is delayed #59

Merged
merged 1 commit into from Apr 8, 2021

Conversation

emagnier
Copy link
Contributor

@emagnier emagnier commented Apr 8, 2021

When you add a startPadding and use the startAfter to delay the scrolling after 'n' seconds: on this few 'n' seconds the startPadding is not applied (internally, the startPosition is not correctly set).

Below, on the first 5 seconds, you can see that the startPadding is ignored, and cause a "jump" effect when it starts scrolling:

Apr-08-2021 10-55-30

Marquee(
  text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
  scrollAxis: Axis.horizontal,
  crossAxisAlignment: CrossAxisAlignment.start,
  blankSpace: 100.0,
  showFadingOnlyWhenScrolling: false,
  fadingEdgeStartFraction: 0.1,
  fadingEdgeEndFraction: 0.1,
  startPadding: 15,
  startAfter: Duration(seconds: 3),
  pauseAfterRound: Duration(seconds: 5),
),

This fix here ensures that the startPosition is correctly set from the initState of this Widget.

@MarcelGarus MarcelGarus merged commit e496638 into MarcelGarus:master Apr 8, 2021
@emagnier emagnier deleted the startPosition branch April 8, 2021 12:27
@emagnier emagnier restored the startPosition branch April 8, 2021 12:27
@MarcelGarus
Copy link
Owner

MarcelGarus commented Apr 13, 2021

Published this as 2.1.0. Thanks for contributing!

@emagnier
Copy link
Contributor Author

Great! Thank you.

@emagnier emagnier deleted the startPosition branch April 13, 2021 15:20
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