@nativescript/canvas 1.0.0 → 1.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Canvas/common.d.ts +1 -0
- package/Canvas/common.js +69 -32
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.js +1 -12
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.ios.js +23 -14
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.d.ts +1 -0
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.js +3 -0
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/common.d.ts +3 -1
- package/Canvas2D/CanvasRenderingContext2D/common.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.android.d.ts +3 -1
- package/Canvas2D/CanvasRenderingContext2D/index.android.js +48 -37
- package/Canvas2D/CanvasRenderingContext2D/index.android.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +6 -0
- package/Canvas2D/CanvasRenderingContext2D/index.ios.d.ts +4 -1
- package/Canvas2D/CanvasRenderingContext2D/index.ios.js +119 -113
- package/Canvas2D/CanvasRenderingContext2D/index.ios.js.map +1 -1
- package/Canvas2D/DOMMatrix/common.d.ts +1 -0
- package/Canvas2D/DOMMatrix/common.js +3 -0
- package/Canvas2D/DOMMatrix/common.js.map +1 -1
- package/Canvas2D/ImageData/common.d.ts +1 -0
- package/Canvas2D/ImageData/common.js +3 -0
- package/Canvas2D/ImageData/common.js.map +1 -1
- package/Canvas2D/Path2D/Path2D.android.d.ts +2 -0
- package/Canvas2D/Path2D/Path2D.android.js +8 -0
- package/Canvas2D/Path2D/Path2D.android.js.map +1 -1
- package/Canvas2D/Path2D/Path2D.d.ts +4 -0
- package/Canvas2D/Path2D/Path2D.ios.d.ts +2 -0
- package/Canvas2D/Path2D/Path2D.ios.js +8 -0
- package/Canvas2D/Path2D/Path2D.ios.js.map +1 -1
- package/Canvas2D/Path2D/common.d.ts +4 -1
- package/Canvas2D/Path2D/common.js +3 -0
- package/Canvas2D/Path2D/common.js.map +1 -1
- package/Canvas2D/TextMetrics/common.d.ts +1 -0
- package/Canvas2D/TextMetrics/common.js +3 -0
- package/Canvas2D/TextMetrics/common.js.map +1 -1
- package/ImageAsset/ImageAsset.android.js +4 -4
- package/ImageAsset/ImageAsset.android.js.map +1 -1
- package/ImageAsset/ImageAsset.ios.js +3 -3
- package/ImageAsset/ImageAsset.ios.js.map +1 -1
- package/ImageAsset/common.d.ts +1 -0
- package/ImageAsset/common.js +3 -0
- package/ImageAsset/common.js.map +1 -1
- package/ImageBitmap/common.d.ts +1 -0
- package/ImageBitmap/common.js +3 -0
- package/ImageBitmap/common.js.map +1 -1
- package/ImageBitmap/index.android.js +47 -21
- package/ImageBitmap/index.android.js.map +1 -1
- package/ImageBitmap/index.ios.d.ts +2 -1
- package/ImageBitmap/index.ios.js +21 -32
- package/ImageBitmap/index.ios.js.map +1 -1
- package/SVG/SVG.js.map +1 -1
- package/TextDecoder/common.d.ts +1 -0
- package/TextDecoder/common.js +3 -0
- package/TextDecoder/common.js.map +1 -1
- package/TextEncoder/common.d.ts +1 -0
- package/TextEncoder/common.js +3 -0
- package/TextEncoder/common.js.map +1 -1
- package/WebGL/WebGLActiveInfo.d.ts +7 -3
- package/WebGL/WebGLActiveInfo.js +26 -3
- package/WebGL/WebGLActiveInfo.js.map +1 -1
- package/WebGL/WebGLProgram.d.ts +0 -1
- package/WebGL/WebGLProgram.js +0 -3
- package/WebGL/WebGLProgram.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.android.js +3 -2
- package/WebGL/WebGLRenderingContext/index.android.js.map +1 -1
- package/angular/esm2020/index.mjs +17 -0
- package/angular/esm2020/nativescript-canvas-angular.mjs +5 -0
- package/angular/fesm2015/nativescript-canvas-angular.mjs +24 -0
- package/angular/fesm2015/nativescript-canvas-angular.mjs.map +1 -0
- package/angular/fesm2020/nativescript-canvas-angular.mjs +24 -0
- package/angular/fesm2020/nativescript-canvas-angular.mjs.map +1 -0
- package/angular/index.d.ts +4 -0
- package/angular/package.json +20 -8
- package/package.json +2 -2
- package/platforms/android/include.gradle +1 -1
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +85 -6
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +68 -32
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +75519 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{arm64.swiftinterface → arm64-apple-ios.private.swiftinterface} +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/module.modulemap +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +160 -12
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +68 -32
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +75519 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{arm64.swiftinterface → arm64-apple-ios-simulator.private.swiftinterface} +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +75519 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/{x86_64.swiftinterface → x86_64-apple-ios-simulator.private.swiftinterface} +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +43 -15
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/module.modulemap +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +41 -85
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/typings/objc!CanvasNative.d.ts +2036 -0
- package/typings/objc!CanvasNative.js +1 -0
- package/typings/objc!CanvasNative.js.map +1 -0
- package/utils.d.ts +3 -1
- package/utils.js +7 -20
- package/utils.js.map +1 -1
- package/angular/bundles/nativescript-canvas-angular.umd.js +0 -29
- package/angular/bundles/nativescript-canvas-angular.umd.js.map +0 -1
- package/angular/esm2015/index.js +0 -12
- package/angular/esm2015/nativescript-canvas-angular.js +0 -5
- package/angular/fesm2015/nativescript-canvas-angular.js +0 -19
- package/angular/fesm2015/nativescript-canvas-angular.js.map +0 -1
- package/angular/nativescript-canvas-angular.d.ts +0 -4
- package/angular/nativescript-canvas-angular.metadata.json +0 -1
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64.swiftdoc +0 -0
|
@@ -14,10 +14,10 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
14
14
|
}
|
|
15
15
|
_fillRuleFromString(string) {
|
|
16
16
|
if (string === 'evenodd') {
|
|
17
|
-
return TNSFillRule.EvenOdd
|
|
17
|
+
return 1 /* TNSFillRule.EvenOdd */;
|
|
18
18
|
}
|
|
19
19
|
else if (string === 'nonzero') {
|
|
20
|
-
return TNSFillRule.NonZero
|
|
20
|
+
return 0 /* TNSFillRule.NonZero */;
|
|
21
21
|
}
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
@@ -29,13 +29,13 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
29
29
|
}
|
|
30
30
|
get direction() {
|
|
31
31
|
this.log('direction');
|
|
32
|
-
return this.context.getDirection() === 0 /* Ltr */ ?
|
|
32
|
+
return this.context.getDirection() === 0 /* TNSTextDirection.Ltr */ ? 'ltr' : 'rtl';
|
|
33
33
|
}
|
|
34
34
|
set direction(value) {
|
|
35
35
|
this.log('direction value:', value);
|
|
36
36
|
this._ensureLayoutBeforeDraw();
|
|
37
37
|
if (this.context) {
|
|
38
|
-
this.context.setDirection(value ===
|
|
38
|
+
this.context.setDirection(value === 'rtl' ? 1 /* TNSTextDirection.Rtl */ : 0 /* TNSTextDirection.Ltr */);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
get font() {
|
|
@@ -84,9 +84,9 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
84
84
|
get imageSmoothingQuality() {
|
|
85
85
|
this.log('get imageSmoothingQuality');
|
|
86
86
|
switch (this.context.imageSmoothingQuality) {
|
|
87
|
-
case 2 /* High */:
|
|
87
|
+
case 2 /* TNSImageSmoothingQuality.High */:
|
|
88
88
|
return 'high';
|
|
89
|
-
case 1 /* Medium */:
|
|
89
|
+
case 1 /* TNSImageSmoothingQuality.Medium */:
|
|
90
90
|
return 'medium';
|
|
91
91
|
default:
|
|
92
92
|
return 'low';
|
|
@@ -98,13 +98,13 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
98
98
|
if (this.context) {
|
|
99
99
|
switch (quality) {
|
|
100
100
|
case 'high':
|
|
101
|
-
this.context.imageSmoothingQuality = 2 /* High */;
|
|
101
|
+
this.context.imageSmoothingQuality = 2 /* TNSImageSmoothingQuality.High */;
|
|
102
102
|
break;
|
|
103
103
|
case 'medium':
|
|
104
|
-
this.context.imageSmoothingQuality = 1 /* Medium */;
|
|
104
|
+
this.context.imageSmoothingQuality = 1 /* TNSImageSmoothingQuality.Medium */;
|
|
105
105
|
break;
|
|
106
106
|
case 'low':
|
|
107
|
-
this.context.imageSmoothingQuality = 0 /* Low */;
|
|
107
|
+
this.context.imageSmoothingQuality = 0 /* TNSImageSmoothingQuality.Low */;
|
|
108
108
|
break;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -123,9 +123,9 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
123
123
|
get lineJoin() {
|
|
124
124
|
this.log('get lineJoin');
|
|
125
125
|
switch (this.context.lineJoin) {
|
|
126
|
-
case 1 /* Bevel */:
|
|
126
|
+
case 1 /* TNSLineJoin.Bevel */:
|
|
127
127
|
return 'bevel';
|
|
128
|
-
case 0 /* Round */:
|
|
128
|
+
case 0 /* TNSLineJoin.Round */:
|
|
129
129
|
return 'round';
|
|
130
130
|
default:
|
|
131
131
|
return 'miter';
|
|
@@ -137,13 +137,13 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
137
137
|
if (this.context) {
|
|
138
138
|
switch (join) {
|
|
139
139
|
case 'bevel':
|
|
140
|
-
this.context.lineJoin = 1 /* Bevel */;
|
|
140
|
+
this.context.lineJoin = 1 /* TNSLineJoin.Bevel */;
|
|
141
141
|
break;
|
|
142
142
|
case 'round':
|
|
143
|
-
this.context.lineJoin = 0 /* Round */;
|
|
143
|
+
this.context.lineJoin = 0 /* TNSLineJoin.Round */;
|
|
144
144
|
break;
|
|
145
145
|
case 'miter':
|
|
146
|
-
this.context.lineJoin = 2 /* Miter */;
|
|
146
|
+
this.context.lineJoin = 2 /* TNSLineJoin.Miter */;
|
|
147
147
|
break;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
@@ -151,9 +151,9 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
151
151
|
get lineCap() {
|
|
152
152
|
this.log('get lineCap');
|
|
153
153
|
switch (this.context.lineCap) {
|
|
154
|
-
case 1 /* Round */:
|
|
154
|
+
case 1 /* TNSLineCap.Round */:
|
|
155
155
|
return 'round';
|
|
156
|
-
case 2 /* Square */:
|
|
156
|
+
case 2 /* TNSLineCap.Square */:
|
|
157
157
|
return 'square';
|
|
158
158
|
default:
|
|
159
159
|
return 'butt';
|
|
@@ -165,13 +165,13 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
165
165
|
if (this.context) {
|
|
166
166
|
switch (cap) {
|
|
167
167
|
case 'round':
|
|
168
|
-
this.context.lineCap = 1 /* Round */;
|
|
168
|
+
this.context.lineCap = 1 /* TNSLineCap.Round */;
|
|
169
169
|
break;
|
|
170
170
|
case 'square':
|
|
171
|
-
this.context.lineCap = 2 /* Square */;
|
|
171
|
+
this.context.lineCap = 2 /* TNSLineCap.Square */;
|
|
172
172
|
break;
|
|
173
173
|
case 'butt':
|
|
174
|
-
this.context.lineCap = 0 /* Butt */;
|
|
174
|
+
this.context.lineCap = 0 /* TNSLineCap.Butt */;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
}
|
|
@@ -222,13 +222,13 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
222
222
|
get textAlign() {
|
|
223
223
|
this.log('get textAlign');
|
|
224
224
|
switch (this.context.textAlign) {
|
|
225
|
-
case 0 /* Start */:
|
|
225
|
+
case 0 /* TNSTextAlignment.Start */:
|
|
226
226
|
return 'start';
|
|
227
|
-
case 2 /* Center */:
|
|
227
|
+
case 2 /* TNSTextAlignment.Center */:
|
|
228
228
|
return 'center';
|
|
229
|
-
case 4 /* End */:
|
|
229
|
+
case 4 /* TNSTextAlignment.End */:
|
|
230
230
|
return 'end';
|
|
231
|
-
case 3 /* Right */:
|
|
231
|
+
case 3 /* TNSTextAlignment.Right */:
|
|
232
232
|
return 'right';
|
|
233
233
|
default:
|
|
234
234
|
return 'left';
|
|
@@ -240,19 +240,19 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
240
240
|
if (this.context) {
|
|
241
241
|
switch (alignment) {
|
|
242
242
|
case 'start':
|
|
243
|
-
this.context.textAlign = 0 /* Start */;
|
|
243
|
+
this.context.textAlign = 0 /* TNSTextAlignment.Start */;
|
|
244
244
|
break;
|
|
245
245
|
case 'center':
|
|
246
|
-
this.context.textAlign = 2 /* Center */;
|
|
246
|
+
this.context.textAlign = 2 /* TNSTextAlignment.Center */;
|
|
247
247
|
break;
|
|
248
248
|
case 'end':
|
|
249
|
-
this.context.textAlign = 4 /* End */;
|
|
249
|
+
this.context.textAlign = 4 /* TNSTextAlignment.End */;
|
|
250
250
|
break;
|
|
251
251
|
case 'right':
|
|
252
|
-
this.context.textAlign = 3 /* Right */;
|
|
252
|
+
this.context.textAlign = 3 /* TNSTextAlignment.Right */;
|
|
253
253
|
break;
|
|
254
254
|
case 'left':
|
|
255
|
-
this.context.textAlign = 1 /* Left */;
|
|
255
|
+
this.context.textAlign = 1 /* TNSTextAlignment.Left */;
|
|
256
256
|
break;
|
|
257
257
|
}
|
|
258
258
|
}
|
|
@@ -260,57 +260,57 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
260
260
|
get globalCompositeOperation() {
|
|
261
261
|
this.log('get globalCompositeOperation');
|
|
262
262
|
switch (this.context.globalCompositeOperation) {
|
|
263
|
-
case 0 /* SourceOver */:
|
|
263
|
+
case 0 /* TNSCompositeOperationType.SourceOver */:
|
|
264
264
|
return 'source-over';
|
|
265
|
-
case 1 /* SourceIn */:
|
|
265
|
+
case 1 /* TNSCompositeOperationType.SourceIn */:
|
|
266
266
|
return 'source-in';
|
|
267
|
-
case 2 /* SourceOut */:
|
|
267
|
+
case 2 /* TNSCompositeOperationType.SourceOut */:
|
|
268
268
|
return 'source-out';
|
|
269
|
-
case 3 /* SourceAtop */:
|
|
269
|
+
case 3 /* TNSCompositeOperationType.SourceAtop */:
|
|
270
270
|
return 'source-atop';
|
|
271
|
-
case 4 /* DestinationOver */:
|
|
271
|
+
case 4 /* TNSCompositeOperationType.DestinationOver */:
|
|
272
272
|
return 'destination-over';
|
|
273
|
-
case 5 /* DestinationIn */:
|
|
273
|
+
case 5 /* TNSCompositeOperationType.DestinationIn */:
|
|
274
274
|
return 'destination-in';
|
|
275
|
-
case 6 /* DestinationOut */:
|
|
275
|
+
case 6 /* TNSCompositeOperationType.DestinationOut */:
|
|
276
276
|
return 'destination-out';
|
|
277
|
-
case 7 /* DestinationAtop */:
|
|
277
|
+
case 7 /* TNSCompositeOperationType.DestinationAtop */:
|
|
278
278
|
return 'destination-atop';
|
|
279
|
-
case 8 /* Lighter */:
|
|
279
|
+
case 8 /* TNSCompositeOperationType.Lighter */:
|
|
280
280
|
return 'lighter';
|
|
281
|
-
case 9 /* Copy */:
|
|
281
|
+
case 9 /* TNSCompositeOperationType.Copy */:
|
|
282
282
|
return 'copy';
|
|
283
|
-
case 10 /* Xor */:
|
|
283
|
+
case 10 /* TNSCompositeOperationType.Xor */:
|
|
284
284
|
return 'xor';
|
|
285
|
-
case 11 /* Multiply */:
|
|
285
|
+
case 11 /* TNSCompositeOperationType.Multiply */:
|
|
286
286
|
return 'multiply';
|
|
287
|
-
case 12 /* Screen */:
|
|
287
|
+
case 12 /* TNSCompositeOperationType.Screen */:
|
|
288
288
|
return 'screen';
|
|
289
|
-
case 13 /* Overlay */:
|
|
289
|
+
case 13 /* TNSCompositeOperationType.Overlay */:
|
|
290
290
|
return 'overlay';
|
|
291
|
-
case 14 /* Darken */:
|
|
291
|
+
case 14 /* TNSCompositeOperationType.Darken */:
|
|
292
292
|
return 'darken';
|
|
293
|
-
case 15 /* Lighten */:
|
|
293
|
+
case 15 /* TNSCompositeOperationType.Lighten */:
|
|
294
294
|
return 'lighten';
|
|
295
|
-
case 16 /* ColorDodge */:
|
|
295
|
+
case 16 /* TNSCompositeOperationType.ColorDodge */:
|
|
296
296
|
return 'color-dodge';
|
|
297
|
-
case 17 /* ColorBurn */:
|
|
297
|
+
case 17 /* TNSCompositeOperationType.ColorBurn */:
|
|
298
298
|
return 'color-burn';
|
|
299
|
-
case 18 /* HardLight */:
|
|
299
|
+
case 18 /* TNSCompositeOperationType.HardLight */:
|
|
300
300
|
return 'hard-light';
|
|
301
|
-
case 19 /* SoftLight */:
|
|
301
|
+
case 19 /* TNSCompositeOperationType.SoftLight */:
|
|
302
302
|
return 'soft-light';
|
|
303
|
-
case 20 /* Difference */:
|
|
303
|
+
case 20 /* TNSCompositeOperationType.Difference */:
|
|
304
304
|
return 'difference';
|
|
305
|
-
case 21 /* Exclusion */:
|
|
305
|
+
case 21 /* TNSCompositeOperationType.Exclusion */:
|
|
306
306
|
return 'exclusion';
|
|
307
|
-
case 22 /* Hue */:
|
|
307
|
+
case 22 /* TNSCompositeOperationType.Hue */:
|
|
308
308
|
return 'hue';
|
|
309
|
-
case 23 /* Saturation */:
|
|
309
|
+
case 23 /* TNSCompositeOperationType.Saturation */:
|
|
310
310
|
return 'saturation';
|
|
311
|
-
case 24 /* Color */:
|
|
311
|
+
case 24 /* TNSCompositeOperationType.Color */:
|
|
312
312
|
return 'color';
|
|
313
|
-
case 25 /* Luminosity */:
|
|
313
|
+
case 25 /* TNSCompositeOperationType.Luminosity */:
|
|
314
314
|
return 'luminosity';
|
|
315
315
|
}
|
|
316
316
|
}
|
|
@@ -320,82 +320,84 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
320
320
|
if (this.context) {
|
|
321
321
|
switch (composite.toLowerCase()) {
|
|
322
322
|
case 'source-over':
|
|
323
|
-
this.context.globalCompositeOperation = 0 /* SourceOver */;
|
|
323
|
+
this.context.globalCompositeOperation = 0 /* TNSCompositeOperationType.SourceOver */;
|
|
324
324
|
break;
|
|
325
325
|
case 'source-in':
|
|
326
|
-
this.context.globalCompositeOperation
|
|
326
|
+
console.log('source-in', this.context.globalCompositeOperation);
|
|
327
|
+
this.context.globalCompositeOperation = 1 /* TNSCompositeOperationType.SourceIn */;
|
|
328
|
+
console.log(this.context.globalCompositeOperation);
|
|
327
329
|
break;
|
|
328
330
|
case 'source-out':
|
|
329
|
-
this.context.globalCompositeOperation = 2 /* SourceOut */;
|
|
331
|
+
this.context.globalCompositeOperation = 2 /* TNSCompositeOperationType.SourceOut */;
|
|
330
332
|
break;
|
|
331
333
|
case 'source-atop':
|
|
332
|
-
this.context.globalCompositeOperation = 3 /* SourceAtop */;
|
|
334
|
+
this.context.globalCompositeOperation = 3 /* TNSCompositeOperationType.SourceAtop */;
|
|
333
335
|
break;
|
|
334
336
|
case 'destination-over':
|
|
335
|
-
this.context.globalCompositeOperation = 4 /* DestinationOver */;
|
|
337
|
+
this.context.globalCompositeOperation = 4 /* TNSCompositeOperationType.DestinationOver */;
|
|
336
338
|
break;
|
|
337
339
|
case 'destination-in':
|
|
338
|
-
this.context.globalCompositeOperation = 5 /* DestinationIn */;
|
|
340
|
+
this.context.globalCompositeOperation = 5 /* TNSCompositeOperationType.DestinationIn */;
|
|
339
341
|
break;
|
|
340
342
|
case 'destination-out':
|
|
341
|
-
this.context.globalCompositeOperation = 6 /* DestinationOut */;
|
|
343
|
+
this.context.globalCompositeOperation = 6 /* TNSCompositeOperationType.DestinationOut */;
|
|
342
344
|
break;
|
|
343
345
|
case 'destination-atop':
|
|
344
|
-
this.context.globalCompositeOperation = 7 /* DestinationAtop */;
|
|
346
|
+
this.context.globalCompositeOperation = 7 /* TNSCompositeOperationType.DestinationAtop */;
|
|
345
347
|
break;
|
|
346
348
|
case 'lighter':
|
|
347
|
-
this.context.globalCompositeOperation = 8 /* Lighter */;
|
|
349
|
+
this.context.globalCompositeOperation = 8 /* TNSCompositeOperationType.Lighter */;
|
|
348
350
|
break;
|
|
349
351
|
case 'copy':
|
|
350
|
-
this.context.globalCompositeOperation = 9 /* Copy */;
|
|
352
|
+
this.context.globalCompositeOperation = 9 /* TNSCompositeOperationType.Copy */;
|
|
351
353
|
break;
|
|
352
354
|
case 'xor':
|
|
353
|
-
this.context.globalCompositeOperation = 10 /* Xor */;
|
|
355
|
+
this.context.globalCompositeOperation = 10 /* TNSCompositeOperationType.Xor */;
|
|
354
356
|
break;
|
|
355
357
|
case 'multiply':
|
|
356
|
-
this.context.globalCompositeOperation = 11 /* Multiply */;
|
|
358
|
+
this.context.globalCompositeOperation = 11 /* TNSCompositeOperationType.Multiply */;
|
|
357
359
|
break;
|
|
358
360
|
case 'screen':
|
|
359
|
-
this.context.globalCompositeOperation = 12 /* Screen */;
|
|
361
|
+
this.context.globalCompositeOperation = 12 /* TNSCompositeOperationType.Screen */;
|
|
360
362
|
break;
|
|
361
363
|
case 'overlay':
|
|
362
|
-
this.context.globalCompositeOperation = 13 /* Overlay */;
|
|
364
|
+
this.context.globalCompositeOperation = 13 /* TNSCompositeOperationType.Overlay */;
|
|
363
365
|
break;
|
|
364
366
|
case 'darken':
|
|
365
|
-
this.context.globalCompositeOperation = 14 /* Darken */;
|
|
367
|
+
this.context.globalCompositeOperation = 14 /* TNSCompositeOperationType.Darken */;
|
|
366
368
|
break;
|
|
367
369
|
case 'lighten':
|
|
368
|
-
this.context.globalCompositeOperation = 15 /* Lighten */;
|
|
370
|
+
this.context.globalCompositeOperation = 15 /* TNSCompositeOperationType.Lighten */;
|
|
369
371
|
break;
|
|
370
372
|
case 'color-dodge':
|
|
371
|
-
this.context.globalCompositeOperation = 16 /* ColorDodge */;
|
|
373
|
+
this.context.globalCompositeOperation = 16 /* TNSCompositeOperationType.ColorDodge */;
|
|
372
374
|
break;
|
|
373
375
|
case 'color-burn':
|
|
374
|
-
this.context.globalCompositeOperation = 17 /* ColorBurn */;
|
|
376
|
+
this.context.globalCompositeOperation = 17 /* TNSCompositeOperationType.ColorBurn */;
|
|
375
377
|
break;
|
|
376
378
|
case 'hard-light':
|
|
377
|
-
this.context.globalCompositeOperation = 18 /* HardLight */;
|
|
379
|
+
this.context.globalCompositeOperation = 18 /* TNSCompositeOperationType.HardLight */;
|
|
378
380
|
break;
|
|
379
381
|
case 'soft-light':
|
|
380
|
-
this.context.globalCompositeOperation = 19 /* SoftLight */;
|
|
382
|
+
this.context.globalCompositeOperation = 19 /* TNSCompositeOperationType.SoftLight */;
|
|
381
383
|
break;
|
|
382
384
|
case 'difference':
|
|
383
|
-
this.context.globalCompositeOperation = 20 /* Difference */;
|
|
385
|
+
this.context.globalCompositeOperation = 20 /* TNSCompositeOperationType.Difference */;
|
|
384
386
|
break;
|
|
385
387
|
case 'exclusion':
|
|
386
|
-
this.context.globalCompositeOperation = 21 /* Exclusion */;
|
|
388
|
+
this.context.globalCompositeOperation = 21 /* TNSCompositeOperationType.Exclusion */;
|
|
387
389
|
break;
|
|
388
390
|
case 'hue':
|
|
389
|
-
this.context.globalCompositeOperation = 22 /* Hue */;
|
|
391
|
+
this.context.globalCompositeOperation = 22 /* TNSCompositeOperationType.Hue */;
|
|
390
392
|
break;
|
|
391
393
|
case 'saturation':
|
|
392
|
-
this.context.globalCompositeOperation = 23 /* Saturation */;
|
|
394
|
+
this.context.globalCompositeOperation = 23 /* TNSCompositeOperationType.Saturation */;
|
|
393
395
|
break;
|
|
394
396
|
case 'color':
|
|
395
|
-
this.context.globalCompositeOperation = 24 /* Color */;
|
|
397
|
+
this.context.globalCompositeOperation = 24 /* TNSCompositeOperationType.Color */;
|
|
396
398
|
break;
|
|
397
399
|
case 'luminosity':
|
|
398
|
-
this.context.globalCompositeOperation = 25 /* Luminosity */;
|
|
400
|
+
this.context.globalCompositeOperation = 25 /* TNSCompositeOperationType.Luminosity */;
|
|
399
401
|
break;
|
|
400
402
|
}
|
|
401
403
|
}
|
|
@@ -413,12 +415,12 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
413
415
|
get fillStyle() {
|
|
414
416
|
this.log('get fillStyle');
|
|
415
417
|
switch (this.context.fillStyle.getStyleType()) {
|
|
416
|
-
case 0 /* Color */:
|
|
418
|
+
case 0 /* CanvasColorStyleType.Color */:
|
|
417
419
|
const color = this.context.fillStyle;
|
|
418
420
|
return color.color;
|
|
419
|
-
case 1 /* Gradient */:
|
|
421
|
+
case 1 /* CanvasColorStyleType.Gradient */:
|
|
420
422
|
return CanvasGradient.fromNative(this.context.fillStyle);
|
|
421
|
-
case 2 /* Pattern */:
|
|
423
|
+
case 2 /* CanvasColorStyleType.Pattern */:
|
|
422
424
|
return new CanvasPattern(this.context.fillStyle);
|
|
423
425
|
}
|
|
424
426
|
}
|
|
@@ -429,7 +431,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
429
431
|
}
|
|
430
432
|
this._ensureLayoutBeforeDraw();
|
|
431
433
|
if (typeof color === 'string') {
|
|
432
|
-
this.context.
|
|
434
|
+
this.context.setFillStyleWithString(color);
|
|
433
435
|
}
|
|
434
436
|
else if (color instanceof CanvasGradient) {
|
|
435
437
|
this.context.fillStyle = color.native;
|
|
@@ -441,12 +443,12 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
441
443
|
get strokeStyle() {
|
|
442
444
|
this.log('get strokeStyle');
|
|
443
445
|
switch (this.context.strokeStyle.getStyleType()) {
|
|
444
|
-
case 0 /* Color */:
|
|
446
|
+
case 0 /* CanvasColorStyleType.Color */:
|
|
445
447
|
const color = this.context.strokeStyle;
|
|
446
448
|
return color.color;
|
|
447
|
-
case 1 /* Gradient */:
|
|
449
|
+
case 1 /* CanvasColorStyleType.Gradient */:
|
|
448
450
|
return CanvasGradient.fromNative(this.context.strokeStyle);
|
|
449
|
-
case 2 /* Pattern */:
|
|
451
|
+
case 2 /* CanvasColorStyleType.Pattern */:
|
|
450
452
|
return new CanvasPattern(this.context.strokeStyle);
|
|
451
453
|
}
|
|
452
454
|
}
|
|
@@ -457,7 +459,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
457
459
|
}
|
|
458
460
|
this._ensureLayoutBeforeDraw();
|
|
459
461
|
if (typeof color === 'string') {
|
|
460
|
-
this.context.
|
|
462
|
+
this.context.setStrokeStyleWithString(color);
|
|
461
463
|
}
|
|
462
464
|
else if (color instanceof CanvasGradient) {
|
|
463
465
|
this.context.strokeStyle = color.native;
|
|
@@ -477,8 +479,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
477
479
|
this.context.lineWidth = width;
|
|
478
480
|
}
|
|
479
481
|
}
|
|
480
|
-
addHitRegion(region) {
|
|
481
|
-
}
|
|
482
|
+
addHitRegion(region) { }
|
|
482
483
|
arc(x, y, radius, startAngle, endAngle, anticlockwise = false) {
|
|
483
484
|
this.log('arc', x, y, radius, startAngle, anticlockwise);
|
|
484
485
|
this._ensureLayoutBeforeDraw();
|
|
@@ -499,8 +500,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
499
500
|
this._ensureLayoutBeforeDraw();
|
|
500
501
|
this.context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
|
|
501
502
|
}
|
|
502
|
-
clearHitRegions() {
|
|
503
|
-
}
|
|
503
|
+
clearHitRegions() { }
|
|
504
504
|
clearRect(x, y, width, height) {
|
|
505
505
|
this.log('clearRect', x, y, width, height);
|
|
506
506
|
this._ensureLayoutBeforeDraw();
|
|
@@ -579,9 +579,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
579
579
|
img = ImageSource.fromFileSync(image.src).ios;
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
else if (image &&
|
|
583
|
-
typeof image.tagName === 'string' &&
|
|
584
|
-
image.tagName === 'CANVAS') {
|
|
582
|
+
else if (image && typeof image.tagName === 'string' && image.tagName === 'CANVAS') {
|
|
585
583
|
if (image._canvas instanceof Canvas) {
|
|
586
584
|
img = image._canvas.ios;
|
|
587
585
|
}
|
|
@@ -595,16 +593,16 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
595
593
|
let rep;
|
|
596
594
|
switch (repetition) {
|
|
597
595
|
case 'no-repeat':
|
|
598
|
-
rep = 3 /* NoRepeat */;
|
|
596
|
+
rep = 3 /* TNSPatternRepetition.NoRepeat */;
|
|
599
597
|
break;
|
|
600
598
|
case 'repeat-x':
|
|
601
|
-
rep = 1 /* RepeatX */;
|
|
599
|
+
rep = 1 /* TNSPatternRepetition.RepeatX */;
|
|
602
600
|
break;
|
|
603
601
|
case 'repeat-y':
|
|
604
|
-
rep = 2 /* RepeatY */;
|
|
602
|
+
rep = 2 /* TNSPatternRepetition.RepeatY */;
|
|
605
603
|
break;
|
|
606
604
|
default:
|
|
607
|
-
rep = 0 /* Repeat */;
|
|
605
|
+
rep = 0 /* TNSPatternRepetition.Repeat */;
|
|
608
606
|
break;
|
|
609
607
|
}
|
|
610
608
|
if (img instanceof TNSImageAsset) {
|
|
@@ -626,8 +624,12 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
626
624
|
this._ensureLayoutBeforeDraw();
|
|
627
625
|
return CanvasGradient.fromNative(this.context.createRadialGradient(x0, y0, r0, x1, y1, r1));
|
|
628
626
|
}
|
|
629
|
-
|
|
627
|
+
createConicGradient(startAngle, x, y) {
|
|
628
|
+
this.log('createConicGradient value:', startAngle, x, y);
|
|
629
|
+
this._ensureLayoutBeforeDraw();
|
|
630
|
+
return CanvasGradient.fromNative(this.context.createConicGradient(startAngle, x, y));
|
|
630
631
|
}
|
|
632
|
+
drawFocusIfNeeded(...args) { }
|
|
631
633
|
drawImage(...args) {
|
|
632
634
|
this.log('drawImage', ...args);
|
|
633
635
|
this._ensureLayoutBeforeDraw();
|
|
@@ -644,9 +646,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
644
646
|
else if (image instanceof ImageAsset || image instanceof UIImage) {
|
|
645
647
|
// NOOP
|
|
646
648
|
}
|
|
647
|
-
else if (image &&
|
|
648
|
-
typeof image.tagName === 'string' &&
|
|
649
|
-
(image.tagName === 'IMG' || image.tagName === 'IMAGE')) {
|
|
649
|
+
else if (image && typeof image.tagName === 'string' && (image.tagName === 'IMG' || image.tagName === 'IMAGE')) {
|
|
650
650
|
width = image.width;
|
|
651
651
|
height = image.height;
|
|
652
652
|
if (image._imageSource instanceof ImageSource) {
|
|
@@ -662,9 +662,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
662
662
|
image = ImageSource.fromFileSync(image.src).ios;
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
else if (image &&
|
|
666
|
-
typeof image.tagName === 'string' &&
|
|
667
|
-
image.tagName === 'CANVAS' && image._canvas instanceof Canvas) {
|
|
665
|
+
else if (image && typeof image.tagName === 'string' && image.tagName === 'CANVAS' && image._canvas instanceof Canvas) {
|
|
668
666
|
image = image._canvas;
|
|
669
667
|
}
|
|
670
668
|
else if (image instanceof ImageBitmap || (image === null || image === void 0 ? void 0 : image.native) instanceof TNSImageBitmap) {
|
|
@@ -736,10 +734,10 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
736
734
|
this.log('fillText', text, x, y, maxWidth);
|
|
737
735
|
this._ensureLayoutBeforeDraw();
|
|
738
736
|
if (typeof maxWidth === 'number') {
|
|
739
|
-
this.context.fillText(text, x, y, maxWidth);
|
|
737
|
+
this.context.fillText(text + '', x, y, maxWidth);
|
|
740
738
|
}
|
|
741
739
|
else {
|
|
742
|
-
this.context.fillText(text, x, y);
|
|
740
|
+
this.context.fillText(text + '', x, y);
|
|
743
741
|
}
|
|
744
742
|
}
|
|
745
743
|
getImageData(sx, sy, sw, sh) {
|
|
@@ -816,8 +814,17 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
816
814
|
this._ensureLayoutBeforeDraw();
|
|
817
815
|
this.context.rect(x, y, width, height);
|
|
818
816
|
}
|
|
819
|
-
|
|
817
|
+
roundRect(x, y, width, height, radii) {
|
|
818
|
+
this.log('rect value:', x, y, width, height);
|
|
819
|
+
this._ensureLayoutBeforeDraw();
|
|
820
|
+
if (Array.isArray(radii)) {
|
|
821
|
+
this.context.roundRect(x, y, width, height, radii);
|
|
822
|
+
}
|
|
823
|
+
else if (typeof radii === 'number') {
|
|
824
|
+
this.context.roundRectWithXYWidthHeightRadii(x, y, width, height, radii);
|
|
825
|
+
}
|
|
820
826
|
}
|
|
827
|
+
removeHitRegion(id) { }
|
|
821
828
|
resetTransform() {
|
|
822
829
|
this.log('resetTransform');
|
|
823
830
|
this._ensureLayoutBeforeDraw();
|
|
@@ -845,8 +852,7 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
845
852
|
this.context.scale(x, y);
|
|
846
853
|
}
|
|
847
854
|
}
|
|
848
|
-
scrollPathIntoView(path) {
|
|
849
|
-
}
|
|
855
|
+
scrollPathIntoView(path) { }
|
|
850
856
|
setLineDash(segments) {
|
|
851
857
|
this.log('setLineDash', segments);
|
|
852
858
|
this._ensureLayoutBeforeDraw();
|
|
@@ -876,10 +882,10 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
876
882
|
this.log('strokeText', text, x, y, maxWidth);
|
|
877
883
|
this._ensureLayoutBeforeDraw();
|
|
878
884
|
if (typeof maxWidth === 'number') {
|
|
879
|
-
this.context.strokeText(text, x, y, maxWidth);
|
|
885
|
+
this.context.strokeText(text + '', x, y, maxWidth);
|
|
880
886
|
}
|
|
881
887
|
else {
|
|
882
|
-
this.context.strokeText(text, x, y);
|
|
888
|
+
this.context.strokeText(text + '', x, y);
|
|
883
889
|
}
|
|
884
890
|
}
|
|
885
891
|
transform(a, b, c, d, e, f) {
|