Fix layout for absolutely positioned nodes with absolutely positioned parents that have border and/or padding

This commit is contained in:
Andrew Rasmussen
2015-04-30 14:35:59 -07:00
parent 0af68d137a
commit 5f52e947cb
6 changed files with 320 additions and 3 deletions

View File

@@ -125,6 +125,10 @@ var computeLayout = (function() {
return getPadding(node, location) + getBorder(node, location);
}
function getBorderAxis(node, axis) {
return getBorder(node, leading[axis]) + getBorder(node, trailing[axis]);
}
function getMarginAxis(node, axis) {
return getMargin(node, leading[axis]) + getMargin(node, trailing[axis]);
}
@@ -703,7 +707,7 @@ var computeLayout = (function() {
isPosDefined(child, trailing[axis])) {
child.layout[dim[axis]] = fmaxf(
boundAxis(child, axis, node.layout[dim[axis]] -
getPaddingAndBorderAxis(node, axis) -
getBorderAxis(node, axis) -
getMarginAxis(child, axis) -
getPosition(child, leading[axis]) -
getPosition(child, trailing[axis])