js: add stretchInset in image

This commit is contained in:
王劲鹏
2020-04-16 17:14:56 +08:00
committed by osborn
parent 357fbd8e66
commit 79d4eafa5a
7 changed files with 48 additions and 0 deletions

View File

@@ -48,5 +48,17 @@ export declare class Image extends View {
width: number;
height: number;
} | undefined) => void;
/**
* Stretch a image according to pointed rect
* Rect contains left, top, right & bottom
* For Android, it is based on nine patch
* For iOS, it is based on cap insets & stretch mode
*/
stretchInset?: {
left: number;
top: number;
right: number;
bottom: number;
};
}
export declare function image(config: Partial<Image>): Image;

View File

@@ -82,6 +82,10 @@ __decorate([
Property,
__metadata("design:type", Function)
], Image.prototype, "loadCallback", void 0);
__decorate([
Property,
__metadata("design:type", Object)
], Image.prototype, "stretchInset", void 0);
export function image(config) {
const ret = new Image;
ret.layoutConfig = layoutConfig().fit();