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