In mj_column/render.js there's the following function:
fn get_mobile_width(&self) -> Option<Size> {
if !self.attribute_exists("mobile-width") {
return Some(Size::percent(100.0));
}
if let Some(width) = self.attribute_as_size("width") {
if width.is_percent() {
Some(width)
} else if width.is_pixel() {
self.container_width
.as_ref()
.map(|w| Size::percent(width.value() / w.value()))
} else {
None
}
} else {
Some(Size::percent(100.0 / (self.non_raw_siblings() as f32)))
}
}
I believe the line .map(|w| Size::percent(width.value() / w.value())) should in fact be .map(|w| Size::percent(width.value() / w.value() * 100.0)). Presently returned percentages for the pixel branch of this function are off by a factor of 100.
In
mj_column/render.jsthere's the following function:I believe the line
.map(|w| Size::percent(width.value() / w.value()))should in fact be.map(|w| Size::percent(width.value() / w.value() * 100.0)). Presently returned percentages for the pixel branch of this function are off by a factor of 100.