Fix the calculation of image heights in ImageFit.scaleDown mode (#4939)

Fixes https://github.com/flutter/flutter/issues/4407
This commit is contained in:
Jason Simmons 2016-07-15 17:04:36 -07:00 committed by GitHub
parent 05e200f12a
commit 94d1104429

View File

@ -869,7 +869,7 @@ void paintImage({
if (destinationSize.height > outputSize.height) if (destinationSize.height > outputSize.height)
destinationSize = new Size(outputSize.height * aspectRatio, outputSize.height); destinationSize = new Size(outputSize.height * aspectRatio, outputSize.height);
if (destinationSize.width > outputSize.width) if (destinationSize.width > outputSize.width)
destinationSize = new Size(outputSize.width, outputSize.height / aspectRatio); destinationSize = new Size(outputSize.width, outputSize.width / aspectRatio);
break; break;
} }
if (centerSlice != null) { if (centerSlice != null) {