Fix: Images have margin when added to Layout

Resolves https://github.com/NativeScript/NativeScript/issues/1425
This commit is contained in:
Rossen Hristov
2016-06-14 10:42:23 +03:00
parent 8af82fb2c8
commit a4294de030

View File

@@ -73,8 +73,8 @@ public class ImageView extends android.widget.ImageView {
if (measureWidth != 0 && measureHeight != 0 && (finiteWidth || finiteHeight)) {
this.computeScaleFactor(width, height, finiteWidth, finiteHeight, measureWidth, measureHeight);
int resultW = (int) Math.floor(measureWidth * this.scaleW);
int resultH = (int) Math.floor(measureHeight * this.scaleH);
int resultW = (int) Math.round(measureWidth * this.scaleW);
int resultH = (int) Math.round(measureHeight * this.scaleH);
measureWidth = finiteWidth ? Math.min(resultW, width) : resultW;
measureHeight = finiteHeight ? Math.min(resultH, height) : resultH;