@nativescript/canvas 2.0.0-alpha.33 → 2.0.0-alpha.35
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.js +4 -0
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.ios.js +1 -0
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +6 -0
- package/Canvas2D/CanvasRenderingContext2D/index.js +18 -0
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.js +6 -6
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +15 -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 +179 -179
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +4 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +4 -3
- 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/canvas_native.h +15 -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 +179 -179
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +4 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +179 -179
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +4 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +4 -3
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +22 -22
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +94 -5
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +25 -3
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
import AVFoundation
|
|
6
6
|
@_exported import CanvasNative
|
|
7
7
|
import CoreVideo
|
|
8
|
-
import OpenGLES.EAGLIOSurface
|
|
9
8
|
import Foundation
|
|
10
9
|
import GLKit
|
|
11
|
-
import IOSurface
|
|
12
10
|
import OpenGLES
|
|
13
11
|
import Swift
|
|
14
12
|
import UIKit
|
|
@@ -50,7 +48,10 @@ import _StringProcessing
|
|
|
50
48
|
@objc @_Concurrency.MainActor(unsafe) public static let store: Foundation.NSMutableDictionary
|
|
51
49
|
@objc @_Concurrency.MainActor(unsafe) public static func getViews() -> Foundation.NSMapTable<Foundation.NSString, CanvasNative.NSCCanvas>
|
|
52
50
|
@objc @_Concurrency.MainActor(unsafe) public func getViewPtr() -> Swift.UnsafeMutableRawPointer
|
|
53
|
-
@objc @_Concurrency.MainActor(unsafe) public var ignorePixelScaling: Swift.Bool
|
|
51
|
+
@objc @_Concurrency.MainActor(unsafe) public var ignorePixelScaling: Swift.Bool {
|
|
52
|
+
@objc get
|
|
53
|
+
@objc set
|
|
54
|
+
}
|
|
54
55
|
@objc @_Concurrency.MainActor(unsafe) public var nativeGL: Swift.Int64 {
|
|
55
56
|
get
|
|
56
57
|
}
|
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
import AVFoundation
|
|
6
6
|
@_exported import CanvasNative
|
|
7
7
|
import CoreVideo
|
|
8
|
-
import OpenGLES.EAGLIOSurface
|
|
9
8
|
import Foundation
|
|
10
9
|
import GLKit
|
|
11
|
-
import IOSurface
|
|
12
10
|
import OpenGLES
|
|
13
11
|
import Swift
|
|
14
12
|
import UIKit
|
|
@@ -50,7 +48,10 @@ import _StringProcessing
|
|
|
50
48
|
@objc @_Concurrency.MainActor(unsafe) public static let store: Foundation.NSMutableDictionary
|
|
51
49
|
@objc @_Concurrency.MainActor(unsafe) public static func getViews() -> Foundation.NSMapTable<Foundation.NSString, CanvasNative.NSCCanvas>
|
|
52
50
|
@objc @_Concurrency.MainActor(unsafe) public func getViewPtr() -> Swift.UnsafeMutableRawPointer
|
|
53
|
-
@objc @_Concurrency.MainActor(unsafe) public var ignorePixelScaling: Swift.Bool
|
|
51
|
+
@objc @_Concurrency.MainActor(unsafe) public var ignorePixelScaling: Swift.Bool {
|
|
52
|
+
@objc get
|
|
53
|
+
@objc set
|
|
54
|
+
}
|
|
54
55
|
@objc @_Concurrency.MainActor(unsafe) public var nativeGL: Swift.Int64 {
|
|
55
56
|
get
|
|
56
57
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</data>
|
|
19
19
|
<key>Headers/canvas_native.h</key>
|
|
20
20
|
<data>
|
|
21
|
-
|
|
21
|
+
pRAw58hbawyHmNg47MpPInfGUXE=
|
|
22
22
|
</data>
|
|
23
23
|
<key>Info.plist</key>
|
|
24
24
|
<data>
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
</data>
|
|
27
27
|
<key>Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo</key>
|
|
28
28
|
<data>
|
|
29
|
-
|
|
29
|
+
M3LTyE6/3lgayHVI/JJvhBgoF2s=
|
|
30
30
|
</data>
|
|
31
31
|
<key>Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
BWm3CiV5veS2dPyEDcCwO09D9aw=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
36
36
|
<data>
|
|
37
|
-
+
|
|
37
|
+
a9E+YfWbt+x966XHk2B1qIGU7yU=
|
|
38
38
|
</data>
|
|
39
39
|
<key>Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
inBGczQvUjm9lsHxlr42D7v1U04=
|
|
42
42
|
</data>
|
|
43
43
|
<key>Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
44
44
|
<data>
|
|
@@ -46,19 +46,19 @@
|
|
|
46
46
|
</data>
|
|
47
47
|
<key>Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
48
48
|
<data>
|
|
49
|
-
|
|
49
|
+
inBGczQvUjm9lsHxlr42D7v1U04=
|
|
50
50
|
</data>
|
|
51
51
|
<key>Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
|
|
52
52
|
<data>
|
|
53
|
-
|
|
53
|
+
bZfMEqv7s4djY7pr7LhpTXK7V6o=
|
|
54
54
|
</data>
|
|
55
55
|
<key>Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
56
56
|
<data>
|
|
57
|
-
+
|
|
57
|
+
a9E+YfWbt+x966XHk2B1qIGU7yU=
|
|
58
58
|
</data>
|
|
59
59
|
<key>Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
60
60
|
<data>
|
|
61
|
-
|
|
61
|
+
yTqFfRNAsSrbxJ3fEcILTeeMEPc=
|
|
62
62
|
</data>
|
|
63
63
|
<key>Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
64
64
|
<data>
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
</data>
|
|
67
67
|
<key>Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
68
68
|
<data>
|
|
69
|
-
|
|
69
|
+
yTqFfRNAsSrbxJ3fEcILTeeMEPc=
|
|
70
70
|
</data>
|
|
71
71
|
<key>Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
|
72
72
|
<data>
|
|
73
|
-
|
|
73
|
+
ipNXwojC/wsIlMsQjUgUskzpvvk=
|
|
74
74
|
</data>
|
|
75
75
|
<key>Modules/module.modulemap</key>
|
|
76
76
|
<data>
|
|
@@ -108,35 +108,35 @@
|
|
|
108
108
|
<dict>
|
|
109
109
|
<key>hash2</key>
|
|
110
110
|
<data>
|
|
111
|
-
|
|
111
|
+
+uJrcducrhwiNwtZ6wBUM2xpn2cfp1O2gq8/4NtuBVU=
|
|
112
112
|
</data>
|
|
113
113
|
</dict>
|
|
114
114
|
<key>Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo</key>
|
|
115
115
|
<dict>
|
|
116
116
|
<key>hash2</key>
|
|
117
117
|
<data>
|
|
118
|
-
|
|
118
|
+
JKTgIE/2lNuocqDqVDcVWDYNRVyzqXyGrOKr/lPZ3Lk=
|
|
119
119
|
</data>
|
|
120
120
|
</dict>
|
|
121
121
|
<key>Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo</key>
|
|
122
122
|
<dict>
|
|
123
123
|
<key>hash2</key>
|
|
124
124
|
<data>
|
|
125
|
-
|
|
125
|
+
hrUi1bKp2PmidEO6u5uXfsKUCTNF2TCohCFPwbCai7w=
|
|
126
126
|
</data>
|
|
127
127
|
</dict>
|
|
128
128
|
<key>Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
129
129
|
<dict>
|
|
130
130
|
<key>hash2</key>
|
|
131
131
|
<data>
|
|
132
|
-
|
|
132
|
+
IA6SkdsT1NGr3Wqd5OaYlFXWSZR/b5VS8UOA40N+bXs=
|
|
133
133
|
</data>
|
|
134
134
|
</dict>
|
|
135
135
|
<key>Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
136
136
|
<dict>
|
|
137
137
|
<key>hash2</key>
|
|
138
138
|
<data>
|
|
139
|
-
|
|
139
|
+
IgoY8nnXBXHGBbuwtmgkwCoVPabGtCPt2hPzjoFWD94=
|
|
140
140
|
</data>
|
|
141
141
|
</dict>
|
|
142
142
|
<key>Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
@@ -150,28 +150,28 @@
|
|
|
150
150
|
<dict>
|
|
151
151
|
<key>hash2</key>
|
|
152
152
|
<data>
|
|
153
|
-
|
|
153
|
+
IgoY8nnXBXHGBbuwtmgkwCoVPabGtCPt2hPzjoFWD94=
|
|
154
154
|
</data>
|
|
155
155
|
</dict>
|
|
156
156
|
<key>Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
|
|
157
157
|
<dict>
|
|
158
158
|
<key>hash2</key>
|
|
159
159
|
<data>
|
|
160
|
-
|
|
160
|
+
USZF2Lg+3qoZG/fIOpKtKyTURBuW91dgOafd0Ca7mGM=
|
|
161
161
|
</data>
|
|
162
162
|
</dict>
|
|
163
163
|
<key>Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
164
164
|
<dict>
|
|
165
165
|
<key>hash2</key>
|
|
166
166
|
<data>
|
|
167
|
-
|
|
167
|
+
IA6SkdsT1NGr3Wqd5OaYlFXWSZR/b5VS8UOA40N+bXs=
|
|
168
168
|
</data>
|
|
169
169
|
</dict>
|
|
170
170
|
<key>Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
171
171
|
<dict>
|
|
172
172
|
<key>hash2</key>
|
|
173
173
|
<data>
|
|
174
|
-
|
|
174
|
+
OXsFDkfWFhzN0IAaF4qXZjPWZYuJfnbjQheRjEZW2zM=
|
|
175
175
|
</data>
|
|
176
176
|
</dict>
|
|
177
177
|
<key>Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
@@ -185,14 +185,14 @@
|
|
|
185
185
|
<dict>
|
|
186
186
|
<key>hash2</key>
|
|
187
187
|
<data>
|
|
188
|
-
|
|
188
|
+
OXsFDkfWFhzN0IAaF4qXZjPWZYuJfnbjQheRjEZW2zM=
|
|
189
189
|
</data>
|
|
190
190
|
</dict>
|
|
191
191
|
<key>Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
|
|
192
192
|
<dict>
|
|
193
193
|
<key>hash2</key>
|
|
194
194
|
<data>
|
|
195
|
-
|
|
195
|
+
OfVLdFjFn5rkONaL4AxlzaVshlvToMD/OqAWjmz0TVE=
|
|
196
196
|
</data>
|
|
197
197
|
</dict>
|
|
198
198
|
<key>Modules/module.modulemap</key>
|
|
Binary file
|
|
@@ -76,6 +76,11 @@ v8::Local<v8::FunctionTemplate> CanvasRenderingContext2DImpl::GetCtor(v8::Isolat
|
|
|
76
76
|
|
|
77
77
|
tmpl->SetAccessor(ConvertToV8String(isolate, "filter"), GetFilter, SetFilter);
|
|
78
78
|
tmpl->SetAccessor(ConvertToV8String(isolate, "font"), GetFont, SetFont);
|
|
79
|
+
tmpl->SetAccessor(ConvertToV8String(isolate, "letterSpacing"), GetLetterSpacing,
|
|
80
|
+
SetLetterSpacing);
|
|
81
|
+
tmpl->SetAccessor(ConvertToV8String(isolate, "wordSpacing"), GetWordSpacing, SetWordSpacing);
|
|
82
|
+
|
|
83
|
+
|
|
79
84
|
tmpl->SetAccessor(ConvertToV8String(isolate, "globalAlpha"), GetGlobalAlpha, SetGlobalAlpha);
|
|
80
85
|
tmpl->SetAccessor(ConvertToV8String(isolate, "imageSmoothingEnabled"), GetImageSmoothingEnabled,
|
|
81
86
|
SetImageSmoothingEnabled);
|
|
@@ -93,6 +98,8 @@ v8::Local<v8::FunctionTemplate> CanvasRenderingContext2DImpl::GetCtor(v8::Isolat
|
|
|
93
98
|
tmpl->SetAccessor(ConvertToV8String(isolate, "shadowOffsetY"), GetShadowOffsetY,
|
|
94
99
|
SetShadowOffsetY);
|
|
95
100
|
tmpl->SetAccessor(ConvertToV8String(isolate, "textAlign"), GetTextAlign, SetTextAlign);
|
|
101
|
+
tmpl->SetAccessor(ConvertToV8String(isolate, "textBaseline"), GetTextBaseline,
|
|
102
|
+
SetTextBaseline);
|
|
96
103
|
tmpl->SetAccessor(ConvertToV8String(isolate, "globalCompositeOperation"),
|
|
97
104
|
GetGlobalCompositeOperation, SetGlobalCompositeOperation);
|
|
98
105
|
tmpl->SetAccessor(ConvertToV8String(isolate, "fillStyle"), GetFillStyle, SetFillStyle);
|
|
@@ -381,6 +388,61 @@ void CanvasRenderingContext2DImpl::SetFont(v8::Local<v8::String> property,
|
|
|
381
388
|
canvas_native_context_set_font(ptr->GetContext(), val.c_str());
|
|
382
389
|
}
|
|
383
390
|
|
|
391
|
+
|
|
392
|
+
void CanvasRenderingContext2DImpl::GetLetterSpacing(v8::Local<v8::String> property,
|
|
393
|
+
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
394
|
+
CanvasRenderingContext2DImpl *ptr = GetPointer(info.This());
|
|
395
|
+
if (ptr == nullptr) {
|
|
396
|
+
info.GetReturnValue().SetEmptyString();
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
auto isolate = info.GetIsolate();
|
|
400
|
+
auto font = canvas_native_context_get_letter_spacing(ptr->GetContext());
|
|
401
|
+
info.GetReturnValue().Set(ConvertToV8String(isolate, font));
|
|
402
|
+
|
|
403
|
+
canvas_native_string_destroy((char *) font);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
void CanvasRenderingContext2DImpl::SetLetterSpacing(v8::Local<v8::String> property,
|
|
407
|
+
v8::Local<v8::Value> value,
|
|
408
|
+
const v8::PropertyCallbackInfo<void> &info) {
|
|
409
|
+
CanvasRenderingContext2DImpl *ptr = GetPointer(info.This());
|
|
410
|
+
if (ptr == nullptr) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
auto isolate = info.GetIsolate();
|
|
414
|
+
auto val = ConvertFromV8String(isolate, value);
|
|
415
|
+
canvas_native_context_set_letter_spacing(ptr->GetContext(), val.c_str());
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
void CanvasRenderingContext2DImpl::GetWordSpacing(v8::Local<v8::String> property,
|
|
420
|
+
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
421
|
+
CanvasRenderingContext2DImpl *ptr = GetPointer(info.This());
|
|
422
|
+
if (ptr == nullptr) {
|
|
423
|
+
info.GetReturnValue().SetEmptyString();
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
auto isolate = info.GetIsolate();
|
|
427
|
+
auto font = canvas_native_context_get_word_spacing(ptr->GetContext());
|
|
428
|
+
info.GetReturnValue().Set(ConvertToV8String(isolate, font));
|
|
429
|
+
|
|
430
|
+
canvas_native_string_destroy((char *) font);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
void CanvasRenderingContext2DImpl::SetWordSpacing(v8::Local<v8::String> property,
|
|
434
|
+
v8::Local<v8::Value> value,
|
|
435
|
+
const v8::PropertyCallbackInfo<void> &info) {
|
|
436
|
+
CanvasRenderingContext2DImpl *ptr = GetPointer(info.This());
|
|
437
|
+
if (ptr == nullptr) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
auto isolate = info.GetIsolate();
|
|
441
|
+
auto val = ConvertFromV8String(isolate, value);
|
|
442
|
+
canvas_native_context_set_word_spacing(ptr->GetContext(), val.c_str());
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
|
|
384
446
|
void CanvasRenderingContext2DImpl::GetGlobalAlpha(v8::Local<v8::String> property,
|
|
385
447
|
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
386
448
|
CanvasRenderingContext2DImpl *ptr = GetPointer(info.This());
|
|
@@ -685,6 +747,33 @@ void CanvasRenderingContext2DImpl::SetTextAlign(v8::Local<v8::String> property,
|
|
|
685
747
|
canvas_native_context_set_text_align(ptr->GetContext(), alignment.c_str());
|
|
686
748
|
}
|
|
687
749
|
|
|
750
|
+
void CanvasRenderingContext2DImpl::GetTextBaseline(v8::Local<v8::String> property,
|
|
751
|
+
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
752
|
+
CanvasRenderingContext2DImpl *ptr = GetPointer(info.This());
|
|
753
|
+
auto isolate = info.GetIsolate();
|
|
754
|
+
if (ptr == nullptr) {
|
|
755
|
+
info.GetReturnValue().Set(0);
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
auto baseline = canvas_native_context_get_text_baseline(ptr->GetContext());
|
|
759
|
+
info.GetReturnValue().Set(
|
|
760
|
+
ConvertToV8String(isolate, baseline));
|
|
761
|
+
canvas_native_string_destroy((char *) baseline);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
void CanvasRenderingContext2DImpl::SetTextBaseline(v8::Local<v8::String> property,
|
|
765
|
+
v8::Local<v8::Value> value,
|
|
766
|
+
const v8::PropertyCallbackInfo<void> &info) {
|
|
767
|
+
CanvasRenderingContext2DImpl *ptr = GetPointer(info.This());
|
|
768
|
+
if (ptr == nullptr) {
|
|
769
|
+
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
auto isolate = info.GetIsolate();
|
|
773
|
+
auto baseline = ConvertFromV8String(isolate, value);
|
|
774
|
+
canvas_native_context_set_text_baseline(ptr->GetContext(), baseline.c_str());
|
|
775
|
+
}
|
|
776
|
+
|
|
688
777
|
|
|
689
778
|
void CanvasRenderingContext2DImpl::GetGlobalCompositeOperation(v8::Local<v8::String> property,
|
|
690
779
|
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
@@ -1706,12 +1795,12 @@ CanvasRenderingContext2DImpl::FillText(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
1706
1795
|
canvas_native_context_fill_text_width(
|
|
1707
1796
|
ptr->GetContext(), text.c_str(), x,
|
|
1708
1797
|
y, width);
|
|
1709
|
-
}else {
|
|
1798
|
+
} else {
|
|
1710
1799
|
canvas_native_context_fill_text(
|
|
1711
1800
|
ptr->GetContext(), text.c_str(), x,
|
|
1712
1801
|
y);
|
|
1713
1802
|
}
|
|
1714
|
-
|
|
1803
|
+
|
|
1715
1804
|
ptr->UpdateInvalidateState();
|
|
1716
1805
|
|
|
1717
1806
|
}
|
|
@@ -2279,14 +2368,14 @@ CanvasRenderingContext2DImpl::StrokeText(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2279
2368
|
float maxWidth = static_cast<float>(args[3]->NumberValue(context).ToChecked());
|
|
2280
2369
|
canvas_native_context_stroke_text_width(
|
|
2281
2370
|
ptr->GetContext(), text.c_str(),
|
|
2282
|
-
x, y,maxWidth);
|
|
2283
|
-
}else {
|
|
2371
|
+
x, y, maxWidth);
|
|
2372
|
+
} else {
|
|
2284
2373
|
canvas_native_context_stroke_text(
|
|
2285
2374
|
ptr->GetContext(), text.c_str(),
|
|
2286
2375
|
x, y);
|
|
2287
2376
|
}
|
|
2288
2377
|
|
|
2289
|
-
|
|
2378
|
+
|
|
2290
2379
|
ptr->UpdateInvalidateState();
|
|
2291
2380
|
}
|
|
2292
2381
|
}
|
|
@@ -72,6 +72,21 @@ public:
|
|
|
72
72
|
v8::Local<v8::Value> value,
|
|
73
73
|
const v8::PropertyCallbackInfo<void> &info);
|
|
74
74
|
|
|
75
|
+
|
|
76
|
+
static void GetLetterSpacing(v8::Local<v8::String> property,
|
|
77
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
78
|
+
|
|
79
|
+
static void SetLetterSpacing(v8::Local<v8::String> property,
|
|
80
|
+
v8::Local<v8::Value> value,
|
|
81
|
+
const v8::PropertyCallbackInfo<void> &info);
|
|
82
|
+
|
|
83
|
+
static void GetWordSpacing(v8::Local<v8::String> property,
|
|
84
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
85
|
+
|
|
86
|
+
static void SetWordSpacing(v8::Local<v8::String> property,
|
|
87
|
+
v8::Local<v8::Value> value,
|
|
88
|
+
const v8::PropertyCallbackInfo<void> &info);
|
|
89
|
+
|
|
75
90
|
static void SetGlobalAlpha(v8::Local<v8::String> property,
|
|
76
91
|
v8::Local<v8::Value> value,
|
|
77
92
|
const v8::PropertyCallbackInfo<void> &info);
|
|
@@ -151,11 +166,18 @@ public:
|
|
|
151
166
|
const v8::PropertyCallbackInfo<void> &info);
|
|
152
167
|
|
|
153
168
|
static void GetTextAlign(v8::Local<v8::String> property,
|
|
154
|
-
|
|
169
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
155
170
|
|
|
156
171
|
static void SetTextAlign(v8::Local<v8::String> property,
|
|
157
|
-
|
|
158
|
-
|
|
172
|
+
v8::Local<v8::Value> value,
|
|
173
|
+
const v8::PropertyCallbackInfo<void> &info);
|
|
174
|
+
|
|
175
|
+
static void GetTextBaseline(v8::Local<v8::String> property,
|
|
176
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
177
|
+
|
|
178
|
+
static void SetTextBaseline(v8::Local<v8::String> property,
|
|
179
|
+
v8::Local<v8::Value> value,
|
|
180
|
+
const v8::PropertyCallbackInfo<void> &info);
|
|
159
181
|
|
|
160
182
|
static void GetGlobalCompositeOperation(v8::Local<v8::String> property,
|
|
161
183
|
const v8::PropertyCallbackInfo<v8::Value> &info);
|