angular-dynamic-layout
angular-dynamic-layout copied to clipboard
Wrong calculation in positionService#setItemsColumnSpan
items[i].width isn't absolutely safe, the return value has sometimes multiple decimal places, which leads to a wrong calculation of the actual columnSpan because Math.ceil will always return the smallest integer greater than or equal to a given number. Using this limitation seems to work great!
Thanks for your feedback, could you provide an example where that applies?
Using four different templates with different widths, i got this "Item too large" error many times, because sometimes item[i].width had multiple decimals, which led to a colSize of 5 instead of 4. I was using 25vw, 50vw, 75vw and 100vw for the different template widths.
You mean the columnSpan was 5 instead of 4 I assume. I see how we can have errors due to the smallest element width being rounded up.
Using only 2 decimals doesn't fix this though. Imagine your 25vw element has a width of 30.009 and your 50vw 2 * 30.009 = 60.018, in this example keeping 2 decimals only will lead to Math.ceil(60.01 / 30.00) = 3 instead of 2.
I see, i see..mh well we dropped the usage of this plugin in our project, because we didn't need this fully dynamic grid system, so i'm currently not able to spent some time thinking of a good solution for that, sorry..