Add isIOS, isAndroid in platform, and fast ts watcher and transpiler

Image should not requestLayout when sized with 'exactly' spec

Update image tests

Tests will run in ios only
This commit is contained in:
Panayot Cankov
2016-05-27 14:49:22 +03:00
parent 44abf94add
commit 717b5131b1
9 changed files with 272 additions and 41 deletions

View File

@@ -36,6 +36,7 @@ function onImageSourcePropertyChanged(data: dependencyObservable.PropertyChangeD
export class Image extends imageCommon.Image {
private _ios: UIImageView;
private _imageSourceAffectsLayout: boolean = true;
constructor() {
super();
@@ -54,7 +55,7 @@ export class Image extends imageCommon.Image {
public _setNativeImage(nativeImage: any) {
this.ios.image = nativeImage;
if (isNaN(this.width) || isNaN(this.height)) {
if (this._imageSourceAffectsLayout) {
this.requestLayout();
}
}
@@ -77,7 +78,9 @@ export class Image extends imageCommon.Image {
var finiteWidth: boolean = widthMode !== utils.layout.UNSPECIFIED;
var finiteHeight: boolean = heightMode !== utils.layout.UNSPECIFIED;
this._imageSourceAffectsLayout = widthMode !== utils.layout.EXACTLY || heightMode !== utils.layout.EXACTLY;
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);