flex overflow
This commit is contained in:
@@ -209,6 +209,9 @@ var computeLayout = (function() {
|
|||||||
|
|
||||||
if (flexibleChildrenCount) {
|
if (flexibleChildrenCount) {
|
||||||
var/*float*/ flexibleMainDim = remainingMainDim / flexibleChildrenCount;
|
var/*float*/ flexibleMainDim = remainingMainDim / flexibleChildrenCount;
|
||||||
|
if (flexibleMainDim < 0) {
|
||||||
|
flexibleMainDim = 0;
|
||||||
|
}
|
||||||
for (var/*int*/ i = 0; i < node.children.length; ++i) {
|
for (var/*int*/ i = 0; i < node.children.length; ++i) {
|
||||||
var/*css_node_t**/ child = node.children[i];
|
var/*css_node_t**/ child = node.children[i];
|
||||||
if (getFlex(child)) {
|
if (getFlex(child)) {
|
||||||
|
@@ -645,6 +645,22 @@ describe('Layout', function() {
|
|||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should layout node with flex and overflow', function() {
|
||||||
|
testLayout(
|
||||||
|
{style: {height: 300}, children: [
|
||||||
|
{style: {height: 600}},
|
||||||
|
{style: {flex: 1}}
|
||||||
|
]},
|
||||||
|
{width: 0, height: 300, top: 0, left: 0, children: [
|
||||||
|
{width: 0, height: 600, top: 0, left: 0},
|
||||||
|
{width: 0, height: 0, top: 600, left: 0}
|
||||||
|
]}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
it('should layout randomly', function() {
|
it('should layout randomly', function() {
|
||||||
function RNG(seed) {
|
function RNG(seed) {
|
||||||
this.state = seed;
|
this.state = seed;
|
||||||
|
Reference in New Issue
Block a user