Fix: Images have margin when added to Layout

Resolves #1425
This commit is contained in:
Rossen Hristov
2016-06-14 10:39:44 +03:00
parent 423066ac78
commit 4e678a06ff
4 changed files with 25 additions and 2 deletions

View File

@@ -83,8 +83,8 @@ export class Image extends imageCommon.Image {
if (nativeWidth !== 0 && nativeHeight !== 0 && (finiteWidth || finiteHeight)) {
var scale = Image.computeScaleFactor(width, height, finiteWidth, finiteHeight, nativeWidth, nativeHeight, this.stretch);
var resultW = Math.floor(nativeWidth * scale.width);
var resultH = Math.floor(nativeHeight * scale.height);
var resultW = Math.round(nativeWidth * scale.width);
var resultH = Math.round(nativeHeight * scale.height);
measureWidth = finiteWidth ? Math.min(resultW, width) : resultW;
measureHeight = finiteHeight ? Math.min(resultH, height) : resultH;