===================================================================
old
|
new
|
|
98 | 98 | $aspect_ratio = 1; |
99 | 99 | |
100 | 100 | /* Calculate Aspect Ratio */ |
101 | | if ( (int) constant( 'BP_AVATAR_FULL_HEIGHT' ) && ( (int) constant( 'BP_AVATAR_FULL_WIDTH' ) != (int) constant( 'BP_AVATAR_FULL_HEIGHT' ) ) ) |
102 | | $aspect_ratio = (int) constant( 'BP_AVATAR_FULL_WIDTH' ) / (int) constant( 'BP_AVATAR_FULL_HEIGHT' ); |
| 101 | $width = (int) constant( 'BP_AVATAR_FULL_WIDTH' ); |
| 102 | $height = (int) constant( 'BP_AVATAR_FULL_HEIGHT' ); |
| 103 | if ( $height && ( $width != $height ) ) |
| 104 | $aspect_ratio = $width / $height; |
103 | 105 | ?> |
104 | 106 | <script type="text/javascript"> |
105 | 107 | jQuery(window).load( function(){ |
… |
… |
|
108 | 110 | onSelect: showPreview, |
109 | 111 | onSelect: updateCoords, |
110 | 112 | aspectRatio: <?php echo $aspect_ratio ?>, |
111 | | setSelect: [ 50, 50, 200, 200 ] |
| 113 | setSelect: [ 0, 0, <?php echo $width ?>, <?php echo $height ?> ], |
| 114 | minSize: [ <?php echo $width ?>, <?php echo $height ?> ] |
112 | 115 | }); |
113 | 116 | }); |
114 | 117 | |
… |
… |
|
121 | 124 | |
122 | 125 | function showPreview(coords) { |
123 | 126 | if ( parseInt(coords.w) > 0 ) { |
124 | | var rx = 100 / coords.w; |
125 | | var ry = 100 / coords.h; |
| 127 | var rx = <?php echo $width ?> / coords.w; |
| 128 | var ry = <?php echo $height ?> / coords.h; |
126 | 129 | |
127 | 130 | jQuery('#avatar-crop-preview').css({ |
128 | 131 | width: Math.round(rx * <?php echo $image[0] ?>) + 'px', |