#2284 fix aspect ratio with "resize to window"
For some reason the height is getting scaled twice for ugoira, causing a messed up aspect ratio because it was relative to the current height. This makes it relative to the original height, so it should always be correct even after multiple scales.
This commit is contained in:
@@ -358,8 +358,8 @@
|
||||
if ($img.width() > client_width) {
|
||||
var ratio = client_width / $img.width();
|
||||
$img.data("scale_factor", ratio);
|
||||
$img.css("width", $img.width() * ratio);
|
||||
$img.css("height", $img.height() * ratio);
|
||||
$img.css("width", $img.data("original_width") * ratio);
|
||||
$img.css("height", $img.data("original_height") * ratio);
|
||||
}
|
||||
} else {
|
||||
$img.data("scale_factor", 1);
|
||||
|
||||
Reference in New Issue
Block a user