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
MFXProgressBar offset bar location after indeterminate #44
Comments
I noticed this bug too. But then disappeared, so I hoped to not see it anymore. I don't have any idea on how to solve it honestly because the skin is copied from JFoenix. |
I took a quick look at the skin code and wasn't too sure where the issue is either. That being said, I was only using the indeterminate state as a fallback in case my progress manager for some reason did not work. I've just changed to use 0.0 progress now, and I don't see the issue anymore. |
Hey @palexdev, It looks like the issue has to do with the I tested locally and was able to see the issue go away by doing one of the following: Solution 1: Change the 0 index key frame scaleX from
|
KeyFrame kf0 = new KeyFrame(Duration.ZERO, | |
new KeyValue(bar1.scaleXProperty(), 0.7), | |
new KeyValue(bar1.translateXProperty(), -width), | |
new KeyValue(bar2.translateXProperty(), -width) | |
); |
Would become
KeyFrame kf0 = new KeyFrame(Duration.ZERO,
new KeyValue(bar1.scaleXProperty(), 1.0),
new KeyValue(bar1.translateXProperty(), -width),
new KeyValue(bar2.translateXProperty(), -width)
);
Solution 2: Add a call to bar1.setScaleX(1.0);
after call to bar1.setTranslateX(0);
in else state of MFXProgressBarSkin.java#layoutChildren
MaterialFX/materialfx/src/main/java/io/github/palexdev/materialfx/skins/MFXProgressBarSkin.java
Lines 233 to 234
in
160f7f3
bar1.setTranslateX(0);
bar2.setTranslateX(0);
MaterialFX/materialfx/src/main/java/io/github/palexdev/materialfx/skins/MFXProgressBarSkin.java
Lines 233 to 234 in 160f7f3
bar1.setTranslateX(0); | |
bar2.setTranslateX(0); |
Would become
bar1.setTranslateX(0);
bar1.setScaleX(1.0);
bar2.setTranslateX(0);
I did not test the side effects on the animation of intermediate state when using solution 1. I think the best solution is probably number 2, since that one does not have any change or potential side effect on the existing progress bar animation. |
Fix is on the way, I'm writing the changelog right now. |
Awesome, thank you! |
New version released, can you confirm that now everything works properly? |
Seems good so far -- and the updated progress bar looks good too |
Glad you like it 🙂 |
Hello,
I have noticed a bug that occurs in certain scenarios with the MFXProgressBar:
When the progress bar is set to indeterminate, then changed to a standard progress value, the location of the bar is sometimes not reset and the standard progress is offset as a result. This does not happen if the progress bar is never set to indeterminate.
2021-06-08.09-35-17_Trim.mp4
The text was updated successfully, but these errors were encountered: