[ASLayoutSpec] ASStackLayoutJustifyContentSpaceBetween flooring causing issues
I have a ASStackLayoutSpec that contains nine views stacked with .SpaceBetween. The flooring in the following line causes enough extra spacing to make the views not perfectly aligned:
return stackedLayout(style, 0, floorf(violation / numOfSpacings), fmodf(violation, numOfSpacings), unpositionedLayout, constrainedSize);
In my specific case at least, it seems to lay out perfectly like this:
return stackedLayout(style, 0, violation / numOfSpacings, 0, unpositionedLayout, constrainedSize);
Is this something that should be changed, or maybe a new ASStackLayoutJustifyContent case made for?
@maicki - could you make a call on fix / won't fix please?
@hannahmbanana Would be great to have a sample project to reproduce the issue. cc @tomizimobile
Here's a sample project that shows this off. I quickly trimmed out and converted the view I had this issue with, which was using a much older version of ASDK, and jammed it in another project I've used to debug ASDK issues, so excuse the mess ;)
After running the project, just hit the "Show table" button and play with the cell. It's a slider that locks at time intervals, and you'll see that the thumb image in the slider is off-center compared to the stack of views above it (and gets worse as you slide right). Changing the line of code as suggested in my first post lines things up nicely.
The code for that cell with the control is in TimeNode.swift