|
244 | 244 | rough_cell.height = stored_height; |
245 | 245 | } |
246 | 246 |
|
| 247 | + this.min_width = rough_cell.min_width != null? |
| 248 | + rough_cell.min_width : defaults.min_view_width; |
| 249 | + this.min_height = rough_cell.min_height != null ? |
| 250 | + rough_cell.min_height : defaults.min_view_height; |
| 251 | + |
247 | 252 | this.width = |
248 | | - rough_cell.width && rough_cell.width > defaults.min_view_width ? |
249 | | - rough_cell.width : defaults.min_view_width; |
| 253 | + rough_cell.width && rough_cell.width > this.min_width ? |
| 254 | + rough_cell.width : this.min_width; |
250 | 255 | this.height = |
251 | | - rough_cell.height && rough_cell.height > defaults.min_view_height ? |
252 | | - rough_cell.height : defaults.min_view_height; |
| 256 | + rough_cell.height && rough_cell.height > this.min_height ? |
| 257 | + rough_cell.height : this.min_height; |
253 | 258 | ids[ this.id = rough_cell.id || getId()] = this; |
254 | 259 |
|
255 | 260 | this.checked_height = 0; |
|
499 | 504 | { |
500 | 505 | var dim = this.dir == VER ? 'height' : 'width'; |
501 | 506 | var max = this[dim]; |
502 | | - var child = null, i = 0, sum = 0, length = this.children.length, temp = 0; |
| 507 | + var child = null, i = 0, sum = 0, length = this.children.length, temp = 0, min = 0; |
503 | 508 | var auto_dim_count = 0, average_dim = 0; |
504 | 509 | if (length) |
505 | 510 | { |
|
521 | 526 | // allocate space |
522 | 527 | for (i = 0; child = this.children[i++]; ) |
523 | 528 | { |
524 | | - if (child['has_explicit_' + dim] && child[dim] < defaults['min_view_' + dim]) |
| 529 | + min = child['min_' + dim]; |
| 530 | + if (child['has_explicit_' + dim] && child[dim] < min) |
525 | 531 | { |
526 | 532 | // if the dimension is below the minimum limit, set minimum value |
527 | 533 | // and reduce the average to compensate for the distributed pixels |
528 | | - average_dim -= (defaults['min_view_' + dim] - child[dim]) / auto_dim_count; |
529 | | - child[dim] = defaults['min_view_' + dim]; |
| 534 | + average_dim -= (min - child[dim]) / auto_dim_count; |
| 535 | + child[dim] = min; |
530 | 536 | } |
531 | 537 | else if (!child['has_explicit_' + dim]) |
532 | | - child[dim] = average_dim > defaults['min_view_' + dim] ? average_dim : defaults['min_view_' + dim]; |
| 538 | + child[dim] = average_dim > min ? average_dim : min; |
533 | 539 | } |
534 | 540 | } |
535 | 541 | } |
|
538 | 544 | { |
539 | 545 | sum = this.get_total_children_dimension(dim); |
540 | 546 | temp = max - (sum - this.children[length][dim] - 2 * defaults.view_border_width); |
541 | | - if (sum <= max || defaults['min_view_' + dim] < temp) |
| 547 | + min = this.children[length]['min_' + dim]; |
| 548 | + if (sum <= max || min < temp) |
542 | 549 | { |
543 | 550 | this.children[length][dim] = temp; |
544 | 551 | length = this.children.length; |
545 | 552 | break; |
546 | 553 | } |
547 | 554 | else |
548 | 555 | { |
549 | | - this.children[length][dim] = defaults['min_view_' + dim]; |
| 556 | + this.children[length][dim] = min; |
550 | 557 | } |
551 | 558 | } |
552 | 559 |
|
|
628 | 635 | { |
629 | 636 | var delta_applied = 0; |
630 | 637 | var child = null, i = 0; |
631 | | - var deltas = []; |
| 638 | + var deltas = [], min = 0, max = 0; |
632 | 639 | if( this.children.length ) |
633 | 640 | { |
634 | 641 | if( ( dim == 'height' && this.dir == HOR ) || ( dim == 'width' && this.dir == VER ) ) |
|
639 | 646 | { |
640 | 647 | deltas[deltas.length] = child.checkDelta(dim, delta, sibling); |
641 | 648 | } |
642 | | - var min = Math.min.apply(null, deltas); |
643 | | - var max = Math.max.apply(null, deltas); |
| 649 | + min = Math.min.apply(null, deltas); |
| 650 | + max = Math.max.apply(null, deltas); |
644 | 651 | delta_applied = delta > 0 ? max : min; |
645 | 652 | if( max != min ) |
646 | 653 | { |
|
672 | 679 | } |
673 | 680 | else |
674 | 681 | { |
| 682 | + min = this['min_' + dim]; |
675 | 683 | if( delta) |
676 | 684 | { |
677 | 685 | var newDim = this[dim] + delta; |
678 | | - if( newDim >= defaults['min_view_' + dim] || newDim >= this[dim] ) |
| 686 | + if( newDim >= min || newDim >= this[dim] ) |
679 | 687 | { |
680 | 688 | this['checked_' + dim] = newDim; |
681 | 689 | } |
682 | 690 | else |
683 | 691 | { |
684 | | - this['checked_' + dim] = defaults['min_view_' + dim] |
| 692 | + this['checked_' + dim] = min; |
685 | 693 | } |
686 | 694 | delta_applied = delta - ( this['checked_' + dim] - this[dim] ); |
687 | 695 | } |
|
0 commit comments