You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by rf...@apache.org on 2007/12/19 18:12:48 UTC

svn commit: r605623 - /lenya/trunk/src/modules/editors/resources/javascript/insertAsset.js

Author: rfrovarp
Date: Wed Dec 19 09:12:47 2007
New Revision: 605623

URL: http://svn.apache.org/viewvc?rev=605623&view=rev
Log:
Round to nearest integer for scaling. Thanks to Jörn for the suggestion.

Modified:
    lenya/trunk/src/modules/editors/resources/javascript/insertAsset.js

Modified: lenya/trunk/src/modules/editors/resources/javascript/insertAsset.js
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/editors/resources/javascript/insertAsset.js?rev=605623&r1=605622&r2=605623&view=diff
==============================================================================
--- lenya/trunk/src/modules/editors/resources/javascript/insertAsset.js (original)
+++ lenya/trunk/src/modules/editors/resources/javascript/insertAsset.js Wed Dec 19 09:12:47 2007
@@ -36,7 +36,7 @@
   */
 function scaleHeight(width) {
   var ratio = document.forms['insertAsset'].ratio.value;
-  document.forms['insertAsset'].height.value = width * ratio;
+  document.forms['insertAsset'].height.value = Math.round(width * ratio);
   focus(); 
 } 
 
@@ -45,7 +45,7 @@
   */
 function scaleWidth(height) {
   var ratio = document.forms['insertAsset'].ratio.value;
-  document.forms['insertAsset'].width.value = height * 1.0 / ratio;
+  document.forms['insertAsset'].width.value = Math.round(height * 1.0 / ratio);
   focus(); 
 } 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org