image scaleType add an enumeration ScaleToTile.

This commit is contained in:
吴尚昆
2022-03-18 19:07:09 +08:00
committed by osborn
parent 31f45d161f
commit 55ff312312
12 changed files with 33 additions and 142 deletions

View File

@@ -2288,6 +2288,7 @@ exports.ScaleType = void 0;
ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill";
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
ScaleType[ScaleType["ScaleAspectFill"] = 2] = "ScaleAspectFill";
ScaleType[ScaleType["ScaleToTile"] = 3] = "ScaleToTile";
})(exports.ScaleType || (exports.ScaleType = {}));
var Image = /** @class */ (function (_super) {
__extends$e(Image, _super);
@@ -2389,10 +2390,6 @@ var Image = /** @class */ (function (_super) {
Property,
__metadata$b("design:type", Object)
], Image.prototype, "stretchInset", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Object)
], Image.prototype, "tileInset", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Function)

View File

@@ -1706,6 +1706,7 @@ exports.ScaleType = void 0;
ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill";
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
ScaleType[ScaleType["ScaleAspectFill"] = 2] = "ScaleAspectFill";
ScaleType[ScaleType["ScaleToTile"] = 3] = "ScaleToTile";
})(exports.ScaleType || (exports.ScaleType = {}));
class Image extends View {
isAnimating(context) {
@@ -1804,10 +1805,6 @@ __decorate$b([
Property,
__metadata$b("design:type", Object)
], Image.prototype, "stretchInset", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Object)
], Image.prototype, "tileInset", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Function)

View File

@@ -3234,6 +3234,7 @@ exports.ScaleType = void 0;
ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill";
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
ScaleType[ScaleType["ScaleAspectFill"] = 2] = "ScaleAspectFill";
ScaleType[ScaleType["ScaleToTile"] = 3] = "ScaleToTile";
})(exports.ScaleType || (exports.ScaleType = {}));
class Image extends View {
isAnimating(context) {
@@ -3332,10 +3333,6 @@ __decorate$b([
Property,
__metadata$b("design:type", Object)
], Image.prototype, "stretchInset", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Object)
], Image.prototype, "tileInset", void 0);
__decorate$b([
Property,
__metadata$b("design:type", Function)

16
doric-js/index.d.ts vendored
View File

@@ -625,7 +625,8 @@ declare module 'doric/lib/src/widget/image' {
export enum ScaleType {
ScaleToFill = 0,
ScaleAspectFit = 1,
ScaleAspectFill = 2
ScaleAspectFill = 2,
ScaleToTile = 3
}
export class Image extends View {
/**
@@ -702,19 +703,6 @@ declare module 'doric/lib/src/widget/image' {
right: number;
bottom: number;
};
/**
* image tile
*
* If boolean value 'true' is passed, it equals { left: 0, top: 0, right: 0, bottom: 0 }
* Android: only support all area tile, so you'd better pass boolean value.
* iOS: support custom area tile, so you can pass object value and boolean value.
*/
tileInset?: {
left: number;
top: number;
right: number;
bottom: number;
} | boolean;
/**
* Called if loaded image is animated and played end.
*/

View File

@@ -5,7 +5,8 @@ import { Resource } from "../util/resource";
export declare enum ScaleType {
ScaleToFill = 0,
ScaleAspectFit = 1,
ScaleAspectFill = 2
ScaleAspectFill = 2,
ScaleToTile = 3
}
export declare class Image extends View {
/**
@@ -82,19 +83,6 @@ export declare class Image extends View {
right: number;
bottom: number;
};
/**
* image tile
*
* If boolean value 'true' is passed, it equals { left: 0, top: 0, right: 0, bottom: 0 }
* Android: only support all area tile, so you'd better pass boolean value.
* iOS: support custom area tile, so you can pass object value and boolean value.
*/
tileInset?: {
left: number;
top: number;
right: number;
bottom: number;
} | boolean;
/**
* Called if loaded image is animated and played end.
*/

View File

@@ -31,6 +31,7 @@ export var ScaleType;
ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill";
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
ScaleType[ScaleType["ScaleAspectFill"] = 2] = "ScaleAspectFill";
ScaleType[ScaleType["ScaleToTile"] = 3] = "ScaleToTile";
})(ScaleType || (ScaleType = {}));
export class Image extends View {
isAnimating(context) {
@@ -129,10 +130,6 @@ __decorate([
Property,
__metadata("design:type", Object)
], Image.prototype, "stretchInset", void 0);
__decorate([
Property,
__metadata("design:type", Object)
], Image.prototype, "tileInset", void 0);
__decorate([
Property,
__metadata("design:type", Function)

View File

@@ -23,6 +23,7 @@ export enum ScaleType {
ScaleToFill = 0,
ScaleAspectFit,
ScaleAspectFill,
ScaleToTile, // image tile mode
}
export class Image extends View {
@@ -120,21 +121,6 @@ export class Image extends View {
bottom: number
}
/**
* image tile
*
* If boolean value 'true' is passed, it equals { left: 0, top: 0, right: 0, bottom: 0 }
* Android: only support all area tile, so you'd better pass boolean value.
* iOS: support custom area tile, so you can pass object value and boolean value.
*/
@Property
tileInset?: {
left: number,
top: number,
right: number,
bottom: number
} | boolean
/**
* Called if loaded image is animated and played end.
*/