Permalink
Browse files

fix #2

1 parent d744ac6 commit 6917848e7acb49a81b08ea67984d0fc4380804b2 @lautr3k committed Mar 31, 2016
Showing with 23 additions and 23 deletions.
  1. +23 −23 js/main.js
View
@@ -718,31 +718,31 @@ function updateTransformValues() {
var current = transformations[transformAction]; var current = transformations[transformAction];
var uniform = $('#transform input[type=radio]:checked').val() == 'yes'; var uniform = $('#transform input[type=radio]:checked').val() == 'yes';
- if (uniform) { + if (transformAction == 'scale') {
- if (input.x != current.x) { + if (uniform) {
- var ratio = current.x / input.x; + if (input.x != current.x) {
- input.y = (current.y / ratio).toFixed(2); + var ratio = current.x / input.x;
- input.z = (current.z / ratio).toFixed(2); + input.y = (current.y / ratio).toFixed(2);
- $transformY.val(input.y); + input.z = (current.z / ratio).toFixed(2);
- $transformZ.val(input.z); + $transformY.val(input.y);
- } + $transformZ.val(input.z);
- else if (input.y != current.y) { + }
- var ratio = current.y / input.y; + else if (input.y != current.y) {
- input.x = (current.x / ratio).toFixed(2); + var ratio = current.y / input.y;
- input.z = (current.z / ratio).toFixed(2); + input.x = (current.x / ratio).toFixed(2);
- $transformX.val(input.x); + input.z = (current.z / ratio).toFixed(2);
- $transformZ.val(input.z); + $transformX.val(input.x);
- } + $transformZ.val(input.z);
- else if (input.z != current.z) { + }
- var ratio = current.z / input.z; + else if (input.z != current.z) {
- input.x = (current.x / ratio).toFixed(2); + var ratio = current.z / input.z;
- input.y = (current.y / ratio).toFixed(2); + input.x = (current.x / ratio).toFixed(2);
- $transformX.val(input.x); + input.y = (current.y / ratio).toFixed(2);
- $transformY.val(input.y); + $transformX.val(input.x);
+ $transformY.val(input.y);
+ }
} }
- }
- if (transformAction == 'scale') {
input.x <= 0 && (input.x = 1); input.x <= 0 && (input.x = 1);
input.y <= 0 && (input.y = 1); input.y <= 0 && (input.y = 1);
input.z <= 0 && (input.z = 1); input.z <= 0 && (input.z = 1);

0 comments on commit 6917848

Please sign in to comment.