r72320 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72319‎ | r72320 | r72321 >
Date:22:00, 3 September 2010
Author:dale
Status:deferred
Tags:
Comment:
fixed dominate aspect ratio calculation to just let the browser determine the non-domintate size
Modified paths:
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
@@ -670,11 +670,11 @@
671671 };
672672 }
673673 // Fit the image per the provided targetWidth closure
674 - /* mw.log( 'getDominateAspectTransform:: naspect:' +
 674+ /*mw.log( 'getDominateAspectTransform:: naspect:' +
675675 ( natrualSize.width / natrualSize.height ) +
676676 ' taspect: ' + targetSize.width + '/' + targetSize.height + ' = ' + ( targetSize.width / targetSize.height )
677 - );
678 - */
 677+ );*/
 678+
679679 var targetAspect = ( parseFloat( targetSize.width ) / parseFloat( targetSize.height ) )
680680 var natrualAspect = ( natrualSize.width / natrualSize.height );
681681
@@ -682,20 +682,20 @@
683683 // xxx height domination here may be confused refactor this check
684684 if( natrualAspect >= targetAspect ){
685685 transformCss.width = parseFloat( transformPercent ) + '%';
686 - transformCss.height = ( parseFloat( transformPercent ) * (
 686+ /*transformCss.height = ( parseFloat( transformPercent ) * (
687687 ( natrualSize.height / natrualSize.width ) /
688688 ( targetSize.height / targetSize.width )
689689 )
690 - ) + '%';
 690+ ) + '%';*/
691691 }
692692
693693 // Fit vertically
694694 if(! transformCss.height || natrualAspect < targetAspect ){
695695 transformCss.height = parseFloat( transformPercent ) + '%';
696 - transformCss.width = ( parseFloat( transformPercent ) *
697 - ( natrualSize.width / natrualSize.height ) /
 696+ /*transformCss.width = ( parseFloat( transformPercent ) *
 697+ ( natrualSize.height / natrualSize.width ) /
698698 ( targetSize.width / targetSize.height )
699 - ) + '%';
 699+ ) + '%';*/
700700 }
701701 return transformCss;
702702 },

Status & tagging log