Skip to:
Content

BuddyPress.org

Changeset 1796


Ignore:
Timestamp:
09/04/2009 11:15:18 PM (15 years ago)
Author:
apeatling
Message:

Honoring aspect ratio if avatar sizes have been overridden. Props jjj. Fixes #970

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-cssjs.php

    r1688 r1796  
    9595   
    9696    $image = apply_filters( 'bp_inline_cropper_image', getimagesize( $bp->avatar_admin->image->dir ) );
     97
     98    $aspect_ratio = 1;
     99   
     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' );
    97103?>
    98104    <script type="text/javascript">
     
    102108                onSelect: showPreview,
    103109                onSelect: updateCoords,
    104                 aspectRatio: 1,
     110                aspectRatio: <?php echo $aspect_ratio ?>,
    105111                setSelect: [ 50, 50, 200, 200 ]
    106112            });
     
    150156        .custom .jcrop-vline, .custom .jcrop-hline { background: yellow; }
    151157        .custom .jcrop-handle { border-color: black; background-color: #C7BB00; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
    152        
     158        #avatar-crop-pane { width: <?php echo BP_AVATAR_FULL_WIDTH ?>px; height: <?php echo BP_AVATAR_FULL_HEIGHT ?>px; overflow: hidden; }
    153159    </style>
    154160<?php
Note: See TracChangeset for help on using the changeset viewer.