Changeset 12679 for extensions/GThumb
- Timestamp:
- Dec 1, 2011, 3:25:47 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GThumb/js/gthumb.js
r12678 r12679 78 78 width_count = this.margin; 79 79 height = this.margin; 80 max_height = 0; 80 81 available_width = main_width - (width + this.margin); 81 82 line = 1; … … 83 84 84 85 width_count += this.t[i].width + this.margin; 86 max_height = Math.max(this.t[i].height, max_height); 85 87 86 88 if (width_count > available_width) { 87 89 ratio = width_count / available_width; 88 height += Math.round( this.t[i].height / ratio);90 height += Math.round(max_height / ratio); 89 91 line++; 92 max_height = 0; 90 93 width_count = this.margin; 91 94 if (line > 2) { 92 if (height > best_size.height && width/height >min_ratio && height<=this.big_thumb.height) {95 if (height >= best_size.height && width/height >= min_ratio && height<=this.big_thumb.height) { 93 96 best_size = {width:width,height:height} 94 97 } … … 98 101 } 99 102 if (line <= 2) { 100 best_size = {width:width,height:this.big_thumb.height}; 103 if (max_height == 0 || line == 1) { 104 height = this.big_thumb.height; 105 } else { 106 height += max_height; 107 } 108 if (height >= best_size.height && width/height >= min_ratio && height<=this.big_thumb.height) { 109 best_size = {width:width,height:height} 110 } 101 111 } 102 112 }
Note: See TracChangeset
for help on using the changeset viewer.