-
Notifications
You must be signed in to change notification settings - Fork 281
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
isCentered option does not always work as expected #191
Comments
Could you fill out the bug report template so that I can understand your issue better please. Here it is again below:
|
Steps to reproduceI used this template http://codepen.io/pen?template=qrjOpX And added this code to better undestand my situation:
[js]
What is Expected?I expected that all blocks will be centered. What is actually happening?I got incorrect left position for some blocks. Why is actually happening?shuffle.js (dist) Offset (line 785) must be the same for each block. (Maybe i wrong but it works for my situation) My Decisionshuffle.js (dist) Get offset only from first rowMap, and comment others: comment lines 784,785
|
I came across the same problem. I applied the fix proposed by OceanITs, which seems to work. Can this be implemented? |
Yes, there could be a fix implemented, but I'm not focused on Shuffle at the moment. Pull requests that don't just change the generated dist files are welcome. |
Understood. |
[css]
.column:nth-child(1) {
height: 200px !important;
}
[js]
isCentered: true,
////////////////
Current version
https://codepen.io/OceanITs/pen/qPexBq
Fixed version
https://codepen.io/OceanITs/pen/EwqQXN
///////////////////
shuffle.js(dist)
line 784 (lastItem.left) must be the same?
///////////////////
Some fix that work for me
comment lines 784,785
before line 780 add {
// add-fix
var lastItem = rowMap[0][rowMap[0].length - 1];
var end = lastItem.left + lastItem.width;
var offset = Math.round((containerWidth - end) / 2);
}
The text was updated successfully, but these errors were encountered: