bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Incorrect function for fluid interface

Open miguel-simoes opened this issue 14 years ago • 2 comments

The function used for the generation of the fluid interface grid is incorrect. Looking at the function:

1% * (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1))

Changing the variables, using defaults for span1, and refactoring the function:

1% * (6.382978723% * 1) + (2.127659574% -* (1 -1)) <=> 1% * (6.382978723% ) + 0 <=> 1% * 6.382978723% = 0,06382978723% <=> 0.000638297872

In other other words, the function is asking for 1% of the @fluidGridColumnWidth value.

The correct function should be

1 * (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1))

Refactoring:

1 * (6.382978723% * 1) + (2.127659574% -* (1 -1)) <=> 1 * (6.382978723% ) + 0 <=> 1 * 6.382978723% = 6,382978723% <=> 0.0638297872

which will request for 1 time the value of @fluidGridColumnWidth value, which wil end up being the correct value (and expected) 6.382978723%

miguel-simoes avatar Mar 02 '12 12:03 miguel-simoes

Of course that the initial "1 * " can be removed since it won't change anything. Other way to solve this is to change the default values from percentage to absolute and let the 1% from the current function force the unit conversion.

miguel-simoes avatar Mar 02 '12 13:03 miguel-simoes

This has been rewritten in 2.0.2-wip, and I've applied the new function. Looks good, thanks!

mdo avatar Mar 12 '12 05:03 mdo