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

There is no parameter for speed/rate #7

Open
mariolourobert opened this issue Aug 31, 2019 · 1 comment
Open

There is no parameter for speed/rate #7

mariolourobert opened this issue Aug 31, 2019 · 1 comment

Comments

@mariolourobert
Copy link

A parameter for speed/rate, or, in an another point of view, the z-index of the image, may be a good improvement ?

@bruckmatthew
Copy link

This should be an easy fix. A rate property needs to be included and insterted to the code here at line 210 in parallax_image.dart:

Alignment alignment;
if (_scrollPosition.axis == Axis.vertical) {
double value = rate*(_position.dy / _screenSize.height - 0.5).clamp(-1.0, 1.0);
alignment = new Alignment(0.0, value);
} else {
double value = rate*(_position.dx / _screenSize.width - 0.5).clamp(-1.0, 1.0);
alignment = new Alignment(value, 0.0);
}

I've played aroud with changing the values in the package code and negative values work well.

Apologies for not just doing it as I've not edited plugins before. Granted i gave it a try, but it came up with errors. @pulyaevskiy

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

No branches or pull requests

2 participants