@nativescript/canvas 2.0.0-alpha.2 → 2.0.0-alpha.21
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 +2 -0
- package/Canvas/common.js +69 -32
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +8 -0
- package/Canvas/index.android.js +76 -29
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +12 -0
- package/Canvas/index.ios.d.ts +8 -2
- package/Canvas/index.ios.js +129 -77
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasGradient/index.d.ts +7 -2
- package/Canvas2D/CanvasGradient/index.js +14 -2
- package/Canvas2D/CanvasGradient/index.js.map +1 -1
- package/Canvas2D/CanvasPattern/index.d.ts +7 -2
- package/Canvas2D/CanvasPattern/index.js +11 -2
- package/Canvas2D/CanvasPattern/index.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +118 -132
- package/Canvas2D/CanvasRenderingContext2D/{index.android.js → index.js} +229 -238
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -0
- package/Canvas2D/DOMMatrix/index.d.ts +74 -2
- package/Canvas2D/DOMMatrix/index.js +180 -2
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.d.ts +15 -2
- package/Canvas2D/ImageData/index.js +66 -2
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/Canvas2D/Path2D/index.d.ts +19 -2
- package/Canvas2D/Path2D/index.js +82 -2
- package/Canvas2D/Path2D/index.js.map +1 -1
- package/Canvas2D/TextMetrics/index.d.ts +17 -2
- package/Canvas2D/TextMetrics/index.js +44 -2
- package/Canvas2D/TextMetrics/index.js.map +1 -1
- package/Dom/Dom.d.ts +10 -0
- package/Dom/Dom.js +36 -0
- package/Dom/Dom.js.map +1 -0
- package/Dom/Fill.d.ts +4 -0
- package/Dom/Fill.js +8 -0
- package/Dom/Fill.js.map +1 -0
- package/Dom/Group.d.ts +21 -0
- package/Dom/Group.js +179 -0
- package/Dom/Group.js.map +1 -0
- package/Dom/Image.d.ts +12 -0
- package/Dom/Image.js +33 -0
- package/Dom/Image.js.map +1 -0
- package/Dom/Paint.d.ts +15 -0
- package/Dom/Paint.js +57 -0
- package/Dom/Paint.js.map +1 -0
- package/Dom/Shadow.d.ts +10 -0
- package/Dom/Shadow.js +26 -0
- package/Dom/Shadow.js.map +1 -0
- package/Dom/Text.d.ts +9 -0
- package/Dom/Text.js +50 -0
- package/Dom/Text.js.map +1 -0
- package/Dom/index.d.ts +8 -0
- package/Dom/index.js +9 -0
- package/Dom/index.js.map +1 -0
- package/Dom/shapes/Circle.d.ts +21 -0
- package/Dom/shapes/Circle.js +98 -0
- package/Dom/shapes/Circle.js.map +1 -0
- package/Dom/shapes/Line.d.ts +9 -0
- package/Dom/shapes/Line.js +37 -0
- package/Dom/shapes/Line.js.map +1 -0
- package/Dom/shapes/Path.d.ts +8 -0
- package/Dom/shapes/Path.js +31 -0
- package/Dom/shapes/Path.js.map +1 -0
- package/Dom/shapes/Points.d.ts +15 -0
- package/Dom/shapes/Points.js +20 -0
- package/Dom/shapes/Points.js.map +1 -0
- package/Dom/shapes/Rect.d.ts +15 -0
- package/Dom/shapes/Rect.js +63 -0
- package/Dom/shapes/Rect.js.map +1 -0
- package/Dom/shapes/RoundedRect.d.ts +12 -0
- package/Dom/shapes/RoundedRect.js +96 -0
- package/Dom/shapes/RoundedRect.js.map +1 -0
- package/Dom/shapes/index.d.ts +6 -0
- package/Dom/shapes/index.js +7 -0
- package/Dom/shapes/index.js.map +1 -0
- package/ImageAsset/index.d.ts +28 -2
- package/ImageAsset/index.js +154 -2
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/{index.ios.d.ts → index.d.ts} +3 -4
- package/ImageBitmap/{index.android.js → index.js} +52 -36
- package/ImageBitmap/index.js.map +1 -0
- package/LICENSE +201 -0
- package/SVG/SVG.js +1 -1
- package/SVG/SVG.js.map +1 -1
- package/TextDecoder/index.d.ts +7 -2
- package/TextDecoder/index.js +44 -2
- package/TextDecoder/index.js.map +1 -1
- package/TextEncoder/index.d.ts +7 -2
- package/TextEncoder/index.js +42 -2
- package/TextEncoder/index.js.map +1 -1
- package/WebGL/WebGLExtensions/index.d.ts +150 -242
- package/WebGL/WebGLExtensions/{index.android.js → index.js} +18 -75
- package/WebGL/WebGLExtensions/index.js.map +1 -0
- package/WebGL/WebGLRenderingContext/common.d.ts +0 -2
- package/WebGL/WebGLRenderingContext/common.js +0 -10
- package/WebGL/WebGLRenderingContext/common.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.d.ts +153 -293
- package/WebGL/WebGLRenderingContext/{index.android.js → index.js} +193 -309
- package/WebGL/WebGLRenderingContext/index.js.map +1 -0
- package/WebGL2/WebGL2RenderingContext/common.d.ts +1 -0
- package/WebGL2/WebGL2RenderingContext/common.js +3 -0
- package/WebGL2/WebGL2RenderingContext/common.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.d.ts +101 -455
- package/WebGL2/WebGL2RenderingContext/{index.android.js → index.js} +125 -201
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -0
- package/angular/esm2020/index.mjs +4 -4
- package/angular/fesm2015/nativescript-canvas-angular.mjs +4 -4
- package/angular/fesm2020/nativescript-canvas-angular.mjs +4 -4
- package/angular/package.json +2 -2
- package/helpers.js +3 -0
- package/helpers.js.map +1 -1
- package/index.js.map +1 -1
- package/package.json +3 -2
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/android/include.gradle +15 -0
- package/platforms/ios/CanvasNative.xcframework/Info.plist +5 -5
- 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 +209 -1767
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +10 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +142 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2621 -0
- 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 +6571 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +153 -0
- 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 +91 -3202
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/module.modulemap +2 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/{TNSCanvas.nib → NSCCanvas.nib} +0 -0
- 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 +408 -3534
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +10 -2
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +142 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2621 -0
- 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 +6571 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +153 -0
- 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 +91 -3202
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +6571 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +153 -0
- 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 +91 -3202
- 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/{TNSCanvas.nib → NSCCanvas.nib} +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +58 -91
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/Podfile +5 -1
- package/platforms/ios/build.xcconfig +5 -0
- package/platforms/ios/src/CanvasModule.h +8 -0
- package/platforms/ios/src/CanvasModule.mm +14 -0
- package/platforms/ios/src/NSOperationQueueWrapper.h +11 -0
- package/platforms/ios/src/NSOperationQueueWrapper.mm +74 -0
- package/platforms/ios/src/cpp/Caches.cpp +35 -0
- package/platforms/ios/src/cpp/Caches.h +186 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +1582 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.h +33 -0
- package/platforms/ios/src/cpp/Common.h +30 -0
- package/platforms/ios/src/cpp/ConcurrentMap.h +54 -0
- package/platforms/ios/src/cpp/Helpers.h +329 -0
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +802 -0
- package/platforms/ios/src/cpp/ImageAssetImpl.h +62 -0
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +189 -0
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +47 -0
- package/platforms/ios/src/cpp/JSICallback.h +71 -0
- package/platforms/ios/src/cpp/JSIReadFileCallback.h +96 -0
- package/platforms/ios/src/cpp/JSIRuntime.cpp +21 -0
- package/platforms/ios/src/cpp/JSIRuntime.h +7 -0
- package/platforms/ios/src/cpp/OnRafCallback.cpp +25 -0
- package/platforms/ios/src/cpp/OnRafCallback.h +24 -0
- package/platforms/ios/src/cpp/OneByteStringResource.cpp +25 -0
- package/platforms/ios/src/cpp/OneByteStringResource.h +21 -0
- package/platforms/ios/src/cpp/RafImpl.cpp +8 -0
- package/platforms/ios/src/cpp/RafImpl.h +30 -0
- package/platforms/ios/src/cpp/TextDecoderImpl.cpp +188 -0
- package/platforms/ios/src/cpp/TextDecoderImpl.h +34 -0
- package/platforms/ios/src/cpp/TextEncoderImpl.cpp +139 -0
- package/platforms/ios/src/cpp/TextEncoderImpl.h +37 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.cpp +71 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +42 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +89 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +42 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +2402 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +318 -0
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.cpp +203 -0
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +43 -0
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +800 -0
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +188 -0
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +449 -0
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +56 -0
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.cpp +253 -0
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.h +67 -0
- package/platforms/ios/src/cpp/gl.h +79 -0
- package/platforms/ios/src/cpp/gl3stub.c +425 -0
- package/platforms/ios/src/cpp/gl3stub.h +665 -0
- package/platforms/ios/src/cpp/gles3jni.h +37 -0
- package/platforms/ios/src/cpp/include/robin_hood.h +2544 -0
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.cpp +93 -0
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +48 -0
- package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +59 -0
- package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +60 -0
- package/platforms/ios/src/cpp/webgl/WebGLProgram.h +59 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +58 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +6691 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +388 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +119 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.h +69 -0
- package/platforms/ios/src/cpp/webgl/WebGLShader.h +58 -0
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.cpp +50 -0
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +83 -0
- package/platforms/ios/src/cpp/webgl/WebGLTexture.h +57 -0
- package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +64 -0
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.cpp +126 -0
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +41 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.cpp +35 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +36 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.cpp +41 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +37 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.cpp +323 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +62 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +61 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +51 -0
- package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +59 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +61 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +51 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +56 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +53 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +52 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +53 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +54 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.cpp +102 -0
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +87 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +63 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +61 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +59 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +88 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +69 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +65 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +72 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +59 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.cpp +43 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +143 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.cpp +32 -0
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +80 -0
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +4517 -0
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +227 -0
- package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +57 -0
- package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +60 -0
- package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +57 -0
- package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +59 -0
- package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +60 -0
- package/platforms/ios/src/module.modulemap +5 -0
- package/Canvas2D/CanvasGradient/CanvasGradient.android.d.ts +0 -10
- package/Canvas2D/CanvasGradient/CanvasGradient.android.js +0 -26
- package/Canvas2D/CanvasGradient/CanvasGradient.android.js.map +0 -1
- package/Canvas2D/CanvasGradient/CanvasGradient.d.ts +0 -12
- package/Canvas2D/CanvasGradient/CanvasGradient.ios.d.ts +0 -8
- package/Canvas2D/CanvasGradient/CanvasGradient.ios.js +0 -19
- package/Canvas2D/CanvasGradient/CanvasGradient.ios.js.map +0 -1
- package/Canvas2D/CanvasGradient/common.d.ts +0 -3
- package/Canvas2D/CanvasGradient/common.js +0 -3
- package/Canvas2D/CanvasGradient/common.js.map +0 -1
- package/Canvas2D/CanvasPattern/CanvasPattern.android.d.ts +0 -8
- package/Canvas2D/CanvasPattern/CanvasPattern.android.js +0 -20
- package/Canvas2D/CanvasPattern/CanvasPattern.android.js.map +0 -1
- package/Canvas2D/CanvasPattern/CanvasPattern.d.ts +0 -8
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.d.ts +0 -6
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.js +0 -10
- package/Canvas2D/CanvasPattern/CanvasPattern.ios.js.map +0 -1
- package/Canvas2D/CanvasPattern/common.d.ts +0 -7
- package/Canvas2D/CanvasPattern/common.js +0 -9
- package/Canvas2D/CanvasPattern/common.js.map +0 -1
- package/Canvas2D/CanvasRenderingContext2D/common.d.ts +0 -87
- package/Canvas2D/CanvasRenderingContext2D/common.js +0 -12
- package/Canvas2D/CanvasRenderingContext2D/common.js.map +0 -1
- package/Canvas2D/CanvasRenderingContext2D/index.android.d.ts +0 -112
- package/Canvas2D/CanvasRenderingContext2D/index.android.js.map +0 -1
- package/Canvas2D/CanvasRenderingContext2D/index.ios.d.ts +0 -110
- package/Canvas2D/CanvasRenderingContext2D/index.ios.js +0 -897
- package/Canvas2D/CanvasRenderingContext2D/index.ios.js.map +0 -1
- package/Canvas2D/DOMMatrix/DOMMatrix.android.d.ts +0 -72
- package/Canvas2D/DOMMatrix/DOMMatrix.android.js +0 -177
- package/Canvas2D/DOMMatrix/DOMMatrix.android.js.map +0 -1
- package/Canvas2D/DOMMatrix/DOMMatrix.d.ts +0 -30
- package/Canvas2D/DOMMatrix/DOMMatrix.ios.d.ts +0 -48
- package/Canvas2D/DOMMatrix/DOMMatrix.ios.js +0 -142
- package/Canvas2D/DOMMatrix/DOMMatrix.ios.js.map +0 -1
- package/Canvas2D/DOMMatrix/common.d.ts +0 -27
- package/Canvas2D/DOMMatrix/common.js +0 -9
- package/Canvas2D/DOMMatrix/common.js.map +0 -1
- package/Canvas2D/ImageData/ImageData.android.d.ts +0 -9
- package/Canvas2D/ImageData/ImageData.android.js +0 -65
- package/Canvas2D/ImageData/ImageData.android.js.map +0 -1
- package/Canvas2D/ImageData/ImageData.d.ts +0 -11
- package/Canvas2D/ImageData/ImageData.ios.d.ts +0 -10
- package/Canvas2D/ImageData/ImageData.ios.js +0 -45
- package/Canvas2D/ImageData/ImageData.ios.js.map +0 -1
- package/Canvas2D/ImageData/common.d.ts +0 -9
- package/Canvas2D/ImageData/common.js +0 -13
- package/Canvas2D/ImageData/common.js.map +0 -1
- package/Canvas2D/Path2D/Path2D.android.d.ts +0 -18
- package/Canvas2D/Path2D/Path2D.android.js +0 -83
- package/Canvas2D/Path2D/Path2D.android.js.map +0 -1
- package/Canvas2D/Path2D/Path2D.d.ts +0 -26
- package/Canvas2D/Path2D/Path2D.ios.d.ts +0 -15
- package/Canvas2D/Path2D/Path2D.ios.js +0 -55
- package/Canvas2D/Path2D/Path2D.ios.js.map +0 -1
- package/Canvas2D/Path2D/common.d.ts +0 -17
- package/Canvas2D/Path2D/common.js +0 -12
- package/Canvas2D/Path2D/common.js.map +0 -1
- package/Canvas2D/TextMetrics/TextMetrics.android.d.ts +0 -16
- package/Canvas2D/TextMetrics/TextMetrics.android.js +0 -43
- package/Canvas2D/TextMetrics/TextMetrics.android.js.map +0 -1
- package/Canvas2D/TextMetrics/TextMetrics.d.ts +0 -7
- package/Canvas2D/TextMetrics/TextMetrics.ios.d.ts +0 -16
- package/Canvas2D/TextMetrics/TextMetrics.ios.js +0 -43
- package/Canvas2D/TextMetrics/TextMetrics.ios.js.map +0 -1
- package/Canvas2D/TextMetrics/common.d.ts +0 -18
- package/Canvas2D/TextMetrics/common.js +0 -13
- package/Canvas2D/TextMetrics/common.js.map +0 -1
- package/ImageAsset/ImageAsset.android.d.ts +0 -20
- package/ImageAsset/ImageAsset.android.js +0 -149
- package/ImageAsset/ImageAsset.android.js.map +0 -1
- package/ImageAsset/ImageAsset.d.ts +0 -31
- package/ImageAsset/ImageAsset.ios.d.ts +0 -22
- package/ImageAsset/ImageAsset.ios.js +0 -114
- package/ImageAsset/ImageAsset.ios.js.map +0 -1
- package/ImageAsset/common.d.ts +0 -13
- package/ImageAsset/common.js +0 -21
- package/ImageAsset/common.js.map +0 -1
- package/ImageBitmap/common.d.ts +0 -8
- package/ImageBitmap/common.js +0 -9
- package/ImageBitmap/common.js.map +0 -1
- package/ImageBitmap/index.android.d.ts +0 -12
- package/ImageBitmap/index.android.js.map +0 -1
- package/ImageBitmap/index.ios.js +0 -283
- package/ImageBitmap/index.ios.js.map +0 -1
- package/TextDecoder/TextDecoder.android.d.ts +0 -8
- package/TextDecoder/TextDecoder.android.js +0 -52
- package/TextDecoder/TextDecoder.android.js.map +0 -1
- package/TextDecoder/TextDecoder.d.ts +0 -10
- package/TextDecoder/TextDecoder.ios.d.ts +0 -6
- package/TextDecoder/TextDecoder.ios.js +0 -37
- package/TextDecoder/TextDecoder.ios.js.map +0 -1
- package/TextDecoder/common.d.ts +0 -8
- package/TextDecoder/common.js +0 -13
- package/TextDecoder/common.js.map +0 -1
- package/TextEncoder/TextEncoder.android.d.ts +0 -8
- package/TextEncoder/TextEncoder.android.js +0 -50
- package/TextEncoder/TextEncoder.android.js.map +0 -1
- package/TextEncoder/TextEncoder.d.ts +0 -10
- package/TextEncoder/TextEncoder.ios.d.ts +0 -6
- package/TextEncoder/TextEncoder.ios.js +0 -14
- package/TextEncoder/TextEncoder.ios.js.map +0 -1
- package/TextEncoder/common.d.ts +0 -7
- package/TextEncoder/common.js +0 -9
- package/TextEncoder/common.js.map +0 -1
- package/WebGL/WebGLExtensions/index.android.d.ts +0 -209
- package/WebGL/WebGLExtensions/index.android.js.map +0 -1
- package/WebGL/WebGLExtensions/index.ios.d.ts +0 -192
- package/WebGL/WebGLExtensions/index.ios.js +0 -250
- package/WebGL/WebGLExtensions/index.ios.js.map +0 -1
- package/WebGL/WebGLRenderingContext/index.android.d.ts +0 -165
- package/WebGL/WebGLRenderingContext/index.android.js.map +0 -1
- package/WebGL/WebGLRenderingContext/index.ios.d.ts +0 -163
- package/WebGL/WebGLRenderingContext/index.ios.js +0 -1168
- package/WebGL/WebGLRenderingContext/index.ios.js.map +0 -1
- package/WebGL2/WebGL2RenderingContext/index.android.d.ts +0 -103
- package/WebGL2/WebGL2RenderingContext/index.android.js.map +0 -1
- package/WebGL2/WebGL2RenderingContext/index.ios.d.ts +0 -102
- package/WebGL2/WebGL2RenderingContext/index.ios.js +0 -618
- package/WebGL2/WebGL2RenderingContext/index.ios.js.map +0 -1
- package/angular/nativescript-canvas-angular.d.ts +0 -5
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/Utils.h +0 -26
- 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/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64.swiftinterface +0 -3264
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/Utils.h +0 -26
- 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/arm64.swiftinterface +0 -3264
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64.swiftinterface +0 -3264
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CanvasRenderingContext2DBase } from './common';
|
|
2
1
|
import { CanvasGradient } from '../CanvasGradient';
|
|
3
2
|
import { Path2D } from '../Path2D';
|
|
4
3
|
import { ImageData } from '../ImageData';
|
|
@@ -9,10 +8,9 @@ import { CanvasPattern } from '../CanvasPattern';
|
|
|
9
8
|
import { Canvas } from '../../Canvas';
|
|
10
9
|
import { Helpers } from '../../helpers';
|
|
11
10
|
let ctor;
|
|
12
|
-
export class CanvasRenderingContext2D
|
|
11
|
+
export class CanvasRenderingContext2D {
|
|
13
12
|
constructor(context, contextOptions) {
|
|
14
|
-
|
|
15
|
-
this._methodCache = new Map();
|
|
13
|
+
this._type = 'none';
|
|
16
14
|
/*const width = context.getDrawingBufferWidth(); // can use getMeasuredWidth / getMeasuredHeight
|
|
17
15
|
const height = context.getDrawingBufferHeight();
|
|
18
16
|
|
|
@@ -26,6 +24,9 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
26
24
|
const ctxPtr = BigInt(context.toString());
|
|
27
25
|
this.context = ctor(ctxPtr);
|
|
28
26
|
}
|
|
27
|
+
get type() {
|
|
28
|
+
return this._type;
|
|
29
|
+
}
|
|
29
30
|
get native() {
|
|
30
31
|
return this.context;
|
|
31
32
|
}
|
|
@@ -33,161 +34,130 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
33
34
|
return this._canvas;
|
|
34
35
|
}
|
|
35
36
|
get shadowColor() {
|
|
36
|
-
this.log('shadowColor');
|
|
37
37
|
return this.context.shadowColor;
|
|
38
38
|
}
|
|
39
39
|
set shadowColor(color) {
|
|
40
|
-
this.log('shadowColor value:', color);
|
|
41
|
-
this._ensureLayoutBeforeDraw();
|
|
42
40
|
if (this.context) {
|
|
41
|
+
this._ensureLayoutBeforeDraw();
|
|
43
42
|
this.context.shadowColor = color;
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
get font() {
|
|
47
|
-
this.log('get font');
|
|
48
46
|
return this.context.font;
|
|
49
47
|
}
|
|
50
48
|
set font(value) {
|
|
51
|
-
this.log('set font value:', value);
|
|
52
49
|
if (this.context) {
|
|
50
|
+
this._ensureLayoutBeforeDraw();
|
|
53
51
|
this.context.font = value;
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
54
|
get direction() {
|
|
57
|
-
this.log('direction');
|
|
58
55
|
return this.context.direction;
|
|
59
56
|
}
|
|
60
57
|
set direction(value) {
|
|
61
|
-
this.log('direction value:', value);
|
|
62
|
-
this._ensureLayoutBeforeDraw();
|
|
63
58
|
if (this.context) {
|
|
59
|
+
this._ensureLayoutBeforeDraw();
|
|
64
60
|
this.context.direction = value;
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
63
|
get globalAlpha() {
|
|
68
|
-
this.log('globalAlpha');
|
|
69
64
|
return this.context.globalAlpha;
|
|
70
65
|
}
|
|
71
66
|
set globalAlpha(alpha) {
|
|
72
|
-
this.log('globalAlpha value:', alpha);
|
|
73
|
-
this._ensureLayoutBeforeDraw();
|
|
74
67
|
if (this.context) {
|
|
68
|
+
this._ensureLayoutBeforeDraw();
|
|
75
69
|
this.context.globalAlpha = alpha;
|
|
76
70
|
}
|
|
77
71
|
}
|
|
78
72
|
get imageSmoothingEnabled() {
|
|
79
|
-
this.log('imageSmoothingEnabled');
|
|
80
73
|
return this.context.imageSmoothingEnabled;
|
|
81
74
|
}
|
|
82
75
|
set imageSmoothingEnabled(enabled) {
|
|
83
|
-
this.log('imageSmoothingEnabled value:', enabled);
|
|
84
|
-
this._ensureLayoutBeforeDraw();
|
|
85
76
|
if (this.context) {
|
|
77
|
+
this._ensureLayoutBeforeDraw();
|
|
86
78
|
this.context.imageSmoothingEnabled = enabled;
|
|
87
79
|
}
|
|
88
80
|
}
|
|
89
81
|
get imageSmoothingQuality() {
|
|
90
|
-
this.log('imageSmoothingQuality');
|
|
91
82
|
return this.context.imageSmoothingQuality;
|
|
92
83
|
}
|
|
93
84
|
set imageSmoothingQuality(quality) {
|
|
94
|
-
this.log('imageSmoothingQuality value:', quality);
|
|
95
85
|
this._ensureLayoutBeforeDraw();
|
|
96
86
|
this.context.imageSmoothingQuality = quality;
|
|
97
87
|
}
|
|
98
88
|
get lineDashOffset() {
|
|
99
|
-
this.log('lineDashOffset');
|
|
100
89
|
return this.context.lineDashOffset;
|
|
101
90
|
}
|
|
102
91
|
set lineDashOffset(offset) {
|
|
103
|
-
this.log('lineDashOffset value:', offset);
|
|
104
|
-
this._ensureLayoutBeforeDraw();
|
|
105
92
|
if (this.context) {
|
|
93
|
+
this._ensureLayoutBeforeDraw();
|
|
106
94
|
this.context.lineDashOffset = offset;
|
|
107
95
|
}
|
|
108
96
|
}
|
|
109
97
|
get lineJoin() {
|
|
110
|
-
this.log('lineJoin');
|
|
111
98
|
return this.context.lineJoin;
|
|
112
99
|
}
|
|
113
100
|
set lineJoin(join) {
|
|
114
|
-
this.log('lineJoin value:', join);
|
|
115
101
|
this._ensureLayoutBeforeDraw();
|
|
116
102
|
this.context.lineJoin = join;
|
|
117
103
|
}
|
|
118
104
|
get lineCap() {
|
|
119
|
-
this.log('lineCap');
|
|
120
105
|
return this.context.lineCap;
|
|
121
106
|
}
|
|
122
107
|
set lineCap(cap) {
|
|
123
|
-
this.log('lineCap value:', cap);
|
|
124
108
|
this._ensureLayoutBeforeDraw();
|
|
125
109
|
this.context.lineCap = cap;
|
|
126
110
|
}
|
|
127
111
|
get miterLimit() {
|
|
128
|
-
this.log('miterLimit value:');
|
|
129
112
|
return this.context.miterLimit;
|
|
130
113
|
}
|
|
131
114
|
set miterLimit(limit) {
|
|
132
|
-
this.log('miterLimit value:', limit);
|
|
133
115
|
this._ensureLayoutBeforeDraw();
|
|
134
116
|
this.context.miterLimit = limit;
|
|
135
117
|
}
|
|
136
118
|
get shadowBlur() {
|
|
137
|
-
this.log('shadowBlur');
|
|
138
119
|
return this.context.shadowBlur;
|
|
139
120
|
}
|
|
140
121
|
set shadowBlur(blur) {
|
|
141
|
-
this.log('shadowBlur value:', blur);
|
|
142
122
|
this._ensureLayoutBeforeDraw();
|
|
143
123
|
this.context.shadowBlur = blur;
|
|
144
124
|
}
|
|
145
125
|
get shadowOffsetX() {
|
|
146
|
-
this.log('shadowOffsetX');
|
|
147
126
|
return this.context.shadowOffsetX;
|
|
148
127
|
}
|
|
149
128
|
set shadowOffsetX(x) {
|
|
150
|
-
this.log('shadowOffsetX value:', x);
|
|
151
|
-
this._ensureLayoutBeforeDraw();
|
|
152
129
|
if (this.context) {
|
|
130
|
+
this._ensureLayoutBeforeDraw();
|
|
153
131
|
this.context.shadowOffsetX = x;
|
|
154
132
|
}
|
|
155
133
|
}
|
|
156
134
|
get shadowOffsetY() {
|
|
157
|
-
this.log('shadowOffsetY');
|
|
158
135
|
return this.context.shadowOffsetY;
|
|
159
136
|
}
|
|
160
137
|
set shadowOffsetY(y) {
|
|
161
|
-
this.log('shadowOffsetY value:', y);
|
|
162
|
-
this._ensureLayoutBeforeDraw();
|
|
163
138
|
if (this.context) {
|
|
139
|
+
this._ensureLayoutBeforeDraw();
|
|
164
140
|
this.context.shadowOffsetY = y;
|
|
165
141
|
}
|
|
166
142
|
}
|
|
167
143
|
get textAlign() {
|
|
168
|
-
this.log('textAlign');
|
|
169
144
|
return this.context.textAlign;
|
|
170
145
|
}
|
|
171
146
|
set textAlign(alignment) {
|
|
172
|
-
this.log('textAlign value:', alignment);
|
|
173
147
|
this._ensureLayoutBeforeDraw();
|
|
174
148
|
this.context.setTextAlign = alignment;
|
|
175
149
|
}
|
|
176
150
|
get globalCompositeOperation() {
|
|
177
|
-
this.log('globalCompositeOperation');
|
|
178
151
|
return this.context.globalCompositeOperation;
|
|
179
152
|
}
|
|
180
153
|
set globalCompositeOperation(composite) {
|
|
181
|
-
this.log('globalCompositeOperation value:', composite);
|
|
182
154
|
this._ensureLayoutBeforeDraw();
|
|
183
155
|
this.context.globalCompositeOperation = composite;
|
|
184
156
|
}
|
|
185
157
|
get fillStyle() {
|
|
186
|
-
this.log('fillStyle');
|
|
187
158
|
return this.context.fillStyle;
|
|
188
159
|
}
|
|
189
160
|
set fillStyle(color) {
|
|
190
|
-
this.log('fillStyle:', color);
|
|
191
161
|
if (color === undefined || color === null) {
|
|
192
162
|
return;
|
|
193
163
|
}
|
|
@@ -200,19 +170,16 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
200
170
|
}
|
|
201
171
|
}
|
|
202
172
|
get filter() {
|
|
203
|
-
this.log('get filter');
|
|
204
173
|
return this.context.filter;
|
|
205
174
|
}
|
|
206
175
|
set filter(value) {
|
|
207
|
-
this.
|
|
176
|
+
this._ensureLayoutBeforeDraw();
|
|
208
177
|
this.context.filter = value;
|
|
209
178
|
}
|
|
210
179
|
get strokeStyle() {
|
|
211
|
-
this.log('strokeStyle');
|
|
212
180
|
return this.context.strokeStyle;
|
|
213
181
|
}
|
|
214
182
|
set strokeStyle(color) {
|
|
215
|
-
this.log('strokeStyle:', color);
|
|
216
183
|
if (color === undefined || color === null) {
|
|
217
184
|
return;
|
|
218
185
|
}
|
|
@@ -225,84 +192,57 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
225
192
|
}
|
|
226
193
|
}
|
|
227
194
|
get lineWidth() {
|
|
228
|
-
this.log('lineWidth');
|
|
229
195
|
return this.context.lineWidth;
|
|
230
196
|
}
|
|
231
197
|
set lineWidth(width) {
|
|
232
|
-
this.log('lineWidth value:', width);
|
|
233
198
|
this._ensureLayoutBeforeDraw();
|
|
234
199
|
this.context.lineWidth = width;
|
|
235
200
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
if (cached === undefined) {
|
|
239
|
-
const ret = this.context[name];
|
|
240
|
-
this._methodCache.set(name, ret);
|
|
241
|
-
return ret;
|
|
242
|
-
}
|
|
243
|
-
return cached;
|
|
244
|
-
}
|
|
245
|
-
__toDataURL() {
|
|
246
|
-
const __toDataURL = this._getMethod('__toDataURL');
|
|
247
|
-
return __toDataURL(arguments[0], arguments[1]);
|
|
201
|
+
__toDataURL(type = 'image/jpg', quality = 92) {
|
|
202
|
+
return this.context.__toDataURL(type, quality);
|
|
248
203
|
}
|
|
249
204
|
addHitRegion(region) { }
|
|
250
205
|
arc(x, y, radius, startAngle, endAngle, anticlockwise = false) {
|
|
251
|
-
this.log('arc value:', x, y, radius, startAngle, endAngle, anticlockwise);
|
|
252
206
|
this._ensureLayoutBeforeDraw();
|
|
253
|
-
|
|
254
|
-
arc(x, y, radius, startAngle, endAngle, anticlockwise);
|
|
207
|
+
this.context.arc(x, y, radius, startAngle, endAngle, anticlockwise);
|
|
255
208
|
}
|
|
256
209
|
arcTo(x1, y1, x2, y2, radius) {
|
|
257
|
-
this.log('arcTo value:', x1, y1, x2, y2, radius);
|
|
258
210
|
this._ensureLayoutBeforeDraw();
|
|
259
|
-
|
|
260
|
-
arcTo(x1, y1, x2, y2, radius);
|
|
211
|
+
this.context.arcTo(x1, y1, x2, y2, radius);
|
|
261
212
|
}
|
|
262
213
|
beginPath() {
|
|
263
|
-
this.log('beginPath');
|
|
264
214
|
this._ensureLayoutBeforeDraw();
|
|
265
|
-
|
|
266
|
-
beginPath();
|
|
215
|
+
this.context.beginPath();
|
|
267
216
|
}
|
|
268
217
|
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
|
|
269
|
-
this.log('bezierCurveTo value:', cp1x, cp1y, cp2x, cp2y, x, y);
|
|
270
218
|
this._ensureLayoutBeforeDraw();
|
|
271
|
-
|
|
272
|
-
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
|
|
219
|
+
this.context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
|
|
273
220
|
}
|
|
274
221
|
clearHitRegions() { }
|
|
275
222
|
clearRect(x, y, width, height) {
|
|
276
|
-
this.log('clearRect value:', x, y, width, height);
|
|
277
223
|
this._ensureLayoutBeforeDraw();
|
|
278
|
-
|
|
279
|
-
clearRect(x, y, width, height);
|
|
224
|
+
this.context.clearRect(x, y, width, height);
|
|
280
225
|
}
|
|
281
226
|
clip(...args) {
|
|
282
|
-
this.log('clip value:', ...args);
|
|
283
227
|
this._ensureLayoutBeforeDraw();
|
|
284
|
-
const clip = this._getMethod('clip');
|
|
285
228
|
if (typeof args[0] === 'string') {
|
|
286
|
-
clip(args[0]);
|
|
229
|
+
this.context.clip(args[0]);
|
|
287
230
|
}
|
|
288
231
|
else if (args[0] instanceof Path2D && typeof args[1] === 'string') {
|
|
289
|
-
clip(args[0].native, args[1]);
|
|
232
|
+
this.context.clip(args[0].native, args[1]);
|
|
290
233
|
}
|
|
291
234
|
else if (args[0] instanceof Path2D) {
|
|
292
|
-
clip(args[0].native);
|
|
235
|
+
this.context.clip(args[0].native);
|
|
293
236
|
}
|
|
294
237
|
else {
|
|
295
|
-
clip();
|
|
238
|
+
this.context.clip();
|
|
296
239
|
}
|
|
297
240
|
}
|
|
298
241
|
closePath() {
|
|
299
|
-
this.log('closePath');
|
|
300
242
|
this._ensureLayoutBeforeDraw();
|
|
301
|
-
|
|
302
|
-
closePath();
|
|
243
|
+
this.context.closePath();
|
|
303
244
|
}
|
|
304
245
|
createImageData(width, height) {
|
|
305
|
-
this.log('createImageData value:', arguments);
|
|
306
246
|
if (width instanceof ImageData) {
|
|
307
247
|
return new ImageData(width.width, width.height);
|
|
308
248
|
}
|
|
@@ -311,37 +251,49 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
311
251
|
}
|
|
312
252
|
}
|
|
313
253
|
createLinearGradient(x0, y0, x1, y1) {
|
|
314
|
-
this.log('createLinearGradient value:', x0, y0, x1, y1);
|
|
315
254
|
this._ensureLayoutBeforeDraw();
|
|
316
|
-
|
|
317
|
-
return CanvasGradient.fromNative(createLinearGradient(x0, y0, x1, y1));
|
|
255
|
+
return CanvasGradient.fromNative(this.context.createLinearGradient(x0, y0, x1, y1));
|
|
318
256
|
}
|
|
319
257
|
createPattern(image, repetition) {
|
|
320
|
-
var _a;
|
|
321
|
-
this.log('createPattern value:', image, repetition);
|
|
322
258
|
this._ensureLayoutBeforeDraw();
|
|
323
259
|
if (repetition === undefined || typeof repetition !== 'string') {
|
|
324
260
|
const e = new Error('The string did not match the expected pattern.');
|
|
325
261
|
e.name = 'SyntaxError';
|
|
326
262
|
throw e;
|
|
327
263
|
}
|
|
328
|
-
const createPattern = this._getMethod('createPattern');
|
|
264
|
+
//const createPattern = this._getMethod('createPattern');
|
|
265
|
+
//const createPattern = this.context.createPattern;
|
|
329
266
|
let img;
|
|
330
|
-
if (
|
|
267
|
+
if (image?._type === '2d' || image?._type?.indexOf('webgl') > -1) {
|
|
331
268
|
img = image.native;
|
|
332
269
|
}
|
|
333
270
|
else if (image instanceof ImageSource) {
|
|
334
|
-
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
271
|
+
//const ptr = this.context.__getPointer; //this._getMethod('__getPointer');
|
|
272
|
+
//const createPattern = this.context.__createPatternWithNative; //this._getMethod('__createPatternWithNative');
|
|
273
|
+
if (global.isAndroid) {
|
|
274
|
+
img = image.android;
|
|
275
|
+
const pattern = org.nativescript.canvas.NSCCanvasRenderingContext2D.createPattern(long(this.context.__getPointer()), img, repetition);
|
|
276
|
+
return new CanvasPattern(this.context.__createPatternWithNative(pattern));
|
|
277
|
+
}
|
|
278
|
+
if (global.isIOS) {
|
|
279
|
+
img = image.ios;
|
|
280
|
+
const pattern = NSCCanvasRenderingContext2D.createPattern(this.context.__getPointer(), img, repetition);
|
|
281
|
+
return new CanvasPattern(this.context.__createPatternWithNative(pattern));
|
|
282
|
+
}
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
else if (global.isAndroid && image instanceof android.graphics.Bitmap) {
|
|
286
|
+
//const ptr = this.context.__getPointer; //this._getMethod('__getPointer');
|
|
287
|
+
const createPattern = this.context.__createPatternWithNative; //this._getMethod('__createPatternWithNative');
|
|
288
|
+
if (global.isAndroid) {
|
|
289
|
+
const pattern = org.nativescript.canvas.NSCCanvasRenderingContext2D.createPattern(long(this.context.__getPointer()), image, repetition);
|
|
290
|
+
return new CanvasPattern(this.context.__createPatternWithNative(pattern));
|
|
291
|
+
}
|
|
292
|
+
if (global.isIOS) {
|
|
293
|
+
const pattern = NSCCanvasRenderingContext2D.createPattern(this.context.__getPointer(), image, repetition);
|
|
294
|
+
return new CanvasPattern(this.context.__createPatternWithNative(pattern));
|
|
295
|
+
}
|
|
296
|
+
return null;
|
|
345
297
|
}
|
|
346
298
|
else if (image instanceof ImageAsset) {
|
|
347
299
|
img = image.native;
|
|
@@ -350,18 +302,27 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
350
302
|
img = image.native;
|
|
351
303
|
}
|
|
352
304
|
else if (image && typeof image.tagName === 'string' && (image.tagName === 'IMG' || image.tagName === 'IMAGE')) {
|
|
353
|
-
if (image._image instanceof android.graphics.Bitmap) {
|
|
305
|
+
if (global.isAndroid && image._image instanceof android.graphics.Bitmap) {
|
|
306
|
+
//todo ios
|
|
354
307
|
img = image._image;
|
|
355
308
|
}
|
|
356
309
|
else if (image._asset instanceof ImageAsset) {
|
|
357
310
|
img = image._asset.native;
|
|
358
311
|
}
|
|
359
312
|
else if (typeof image.src === 'string') {
|
|
360
|
-
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
313
|
+
//const ptr = this.context.__getPointer; //this._getMethod('__getPointer');
|
|
314
|
+
//const createPattern = this.context.__createPatternWithNative; //this._getMethod('__createPatternWithNative');
|
|
315
|
+
if (global.isAndroid) {
|
|
316
|
+
img = ImageSource.fromFileSync(image.src).android;
|
|
317
|
+
const pattern = org.nativescript.canvas.NSCCanvasRenderingContext2D.createPattern(long(this.context.__getPointer()), img, repetition);
|
|
318
|
+
return new CanvasPattern(this.context.__createPatternWithNative(pattern));
|
|
319
|
+
}
|
|
320
|
+
if (global.isiOS) {
|
|
321
|
+
img = ImageSource.fromFileSync(image.src).android;
|
|
322
|
+
const pattern = NSCCanvasRenderingContext2D.createPattern(this.context.__getPointer(), img, repetition);
|
|
323
|
+
return new CanvasPattern(this.context.__createPatternWithNative(pattern));
|
|
324
|
+
}
|
|
325
|
+
return null;
|
|
365
326
|
}
|
|
366
327
|
}
|
|
367
328
|
else if (image && typeof image.tagName === 'string' && image.tagName === 'CANVAS' && image._canvas instanceof Canvas) {
|
|
@@ -373,64 +334,121 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
373
334
|
if (!img) {
|
|
374
335
|
return null;
|
|
375
336
|
}
|
|
376
|
-
return new CanvasPattern(createPattern(img, repetition));
|
|
337
|
+
return new CanvasPattern(this.context.createPattern(img, repetition));
|
|
377
338
|
}
|
|
378
339
|
createRadialGradient(x0, y0, r0, x1, y1, r1) {
|
|
379
|
-
this.log('createRadialGradient value:', x0, y0, r0, x1, y1, r1);
|
|
380
340
|
this._ensureLayoutBeforeDraw();
|
|
381
|
-
const createRadialGradient = this._getMethod('createRadialGradient');
|
|
382
|
-
return CanvasGradient.fromNative(createRadialGradient(x0, y0, r0, x1, y1, r1));
|
|
341
|
+
//const createRadialGradient = this._getMethod('createRadialGradient');
|
|
342
|
+
return CanvasGradient.fromNative(this.context.createRadialGradient(x0, y0, r0, x1, y1, r1));
|
|
343
|
+
}
|
|
344
|
+
drawPaint(color) {
|
|
345
|
+
this._ensureLayoutBeforeDraw();
|
|
346
|
+
//const drawPaint = this._getMethod('drawPaint');
|
|
347
|
+
this.context.drawPaint(color);
|
|
348
|
+
}
|
|
349
|
+
drawPoint(x, y) {
|
|
350
|
+
this._ensureLayoutBeforeDraw();
|
|
351
|
+
//const drawPoint = this._getMethod('drawPoint');
|
|
352
|
+
this.context.drawPoint(x, y);
|
|
353
|
+
}
|
|
354
|
+
drawPoints(mode, points) {
|
|
355
|
+
this._ensureLayoutBeforeDraw();
|
|
356
|
+
//const drawPoints = this._getMethod('drawPoints');
|
|
357
|
+
this.context.drawPoints(mode, points);
|
|
383
358
|
}
|
|
384
359
|
drawFocusIfNeeded(...args) { }
|
|
385
360
|
drawImage(...args) {
|
|
386
|
-
var _a;
|
|
387
|
-
this.log('drawImage value:', ...args);
|
|
388
361
|
this._ensureLayoutBeforeDraw();
|
|
389
|
-
const drawImage = this._getMethod('drawImage');
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
else if (image instanceof ImageAsset) {
|
|
395
|
-
image = image.native;
|
|
396
|
-
}
|
|
397
|
-
else if (image instanceof ImageSource) {
|
|
398
|
-
image = image.android;
|
|
399
|
-
const ptr = this._getMethod('__getPointer');
|
|
400
|
-
const makeDirty = this._getMethod('__makeDirty');
|
|
362
|
+
//const drawImage = this.context.drawImage; //this._getMethod('drawImage');
|
|
363
|
+
const drawNativeImage = (args, image) => {
|
|
364
|
+
//const ptr = this.context.__getPointer; //this._getMethod('__getPointer');
|
|
365
|
+
//const makeDirty = this.context.__makeDirty; //this._getMethod('__makeDirty');
|
|
401
366
|
let dirty = false;
|
|
402
367
|
if (args.length === 3) {
|
|
403
|
-
|
|
368
|
+
if (global.isAndroid) {
|
|
369
|
+
dirty = org.nativescript.canvas.NSCCanvasRenderingContext2D.drawImage(long(this.context.__getPointer()), image, args[1], args[2]);
|
|
370
|
+
}
|
|
371
|
+
if (global.isIOS) {
|
|
372
|
+
dirty = NSCCanvasRenderingContext2D.drawImage(this.context.__getPointer(), image, args[1], args[2]);
|
|
373
|
+
}
|
|
404
374
|
}
|
|
405
375
|
else if (args.length === 5) {
|
|
406
|
-
|
|
376
|
+
if (global.isAndroid) {
|
|
377
|
+
dirty = org.nativescript.canvas.NSCCanvasRenderingContext2D.drawImage(long(this.context.__getPointer()), image, args[1], args[2], args[3], args[4]);
|
|
378
|
+
}
|
|
379
|
+
if (global.isIOS) {
|
|
380
|
+
dirty = NSCCanvasRenderingContext2D.drawImage(this.context.__getPointer(), image, args[1], args[2], args[3], args[4]);
|
|
381
|
+
}
|
|
407
382
|
}
|
|
408
383
|
else if (args.length === 9) {
|
|
409
|
-
|
|
384
|
+
if (global.Android) {
|
|
385
|
+
dirty = org.nativescript.canvas.NSCCanvasRenderingContext2D.drawImage(long(this.context.__getPointer()), image, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
|
|
386
|
+
}
|
|
387
|
+
if (global.isIOS) {
|
|
388
|
+
dirty = NSCCanvasRenderingContext2D.drawImage(this.context.__getPointer(), image, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
|
|
389
|
+
}
|
|
410
390
|
}
|
|
411
391
|
if (dirty) {
|
|
412
|
-
|
|
392
|
+
this.context.__makeDirty();
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
let image = args[0];
|
|
396
|
+
if (image?._type === '2d' || image?._type?.indexOf('webgl') > -1) {
|
|
397
|
+
image = image.native;
|
|
398
|
+
}
|
|
399
|
+
else if (image instanceof ImageAsset) {
|
|
400
|
+
image = image.native;
|
|
401
|
+
}
|
|
402
|
+
else if (image instanceof ImageSource) {
|
|
403
|
+
if (global.isAndroid) {
|
|
404
|
+
drawNativeImage(args, image.android);
|
|
405
|
+
}
|
|
406
|
+
if (global.isIOS) {
|
|
407
|
+
drawNativeImage(args, image.ios);
|
|
413
408
|
}
|
|
414
409
|
return;
|
|
415
410
|
}
|
|
416
|
-
else if (image instanceof android.graphics.Bitmap) {
|
|
417
|
-
|
|
411
|
+
else if (global.isAndroid && image instanceof android.graphics.Bitmap) {
|
|
412
|
+
drawNativeImage(args, image);
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
else if (global.isIOS && image instanceof UIImage) {
|
|
416
|
+
drawNativeImage(args, image);
|
|
417
|
+
return;
|
|
418
418
|
}
|
|
419
419
|
else if (image instanceof Canvas) {
|
|
420
420
|
image = image.native;
|
|
421
421
|
}
|
|
422
422
|
else if (image && typeof image.tagName === 'string' && (image.tagName === 'IMG' || image.tagName === 'IMAGE')) {
|
|
423
423
|
if (image._imageSource instanceof ImageSource) {
|
|
424
|
-
|
|
424
|
+
if (global.isAndroid) {
|
|
425
|
+
drawNativeImage(args, image._imageSource.android);
|
|
426
|
+
}
|
|
427
|
+
if (global.isIOS) {
|
|
428
|
+
drawNativeImage(args, image._imageSource.ios);
|
|
429
|
+
}
|
|
430
|
+
return;
|
|
425
431
|
}
|
|
426
|
-
else if (image._image instanceof android.graphics.Bitmap) {
|
|
427
|
-
|
|
432
|
+
else if (global.isAndroid && image._image instanceof android.graphics.Bitmap) {
|
|
433
|
+
drawNativeImage(args, image._image);
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
else if (global.isIOS && image._image instanceof UIImage) {
|
|
437
|
+
drawNativeImage(args, image._image);
|
|
438
|
+
return;
|
|
428
439
|
}
|
|
429
440
|
else if (image._asset instanceof ImageAsset) {
|
|
430
441
|
image = image._asset.native;
|
|
431
442
|
}
|
|
432
443
|
else if (typeof image.src === 'string') {
|
|
433
444
|
image = ImageSource.fromFileSync(image.src).android;
|
|
445
|
+
if (global.isAndroid) {
|
|
446
|
+
drawNativeImage(args, image.android);
|
|
447
|
+
}
|
|
448
|
+
if (global.isIOS) {
|
|
449
|
+
drawNativeImage(args, image.ios);
|
|
450
|
+
}
|
|
451
|
+
return;
|
|
434
452
|
}
|
|
435
453
|
}
|
|
436
454
|
else if (image && typeof image.tagName === 'string' && image.tagName === 'CANVAS' && image._canvas instanceof Canvas) {
|
|
@@ -440,239 +458,212 @@ export class CanvasRenderingContext2D extends CanvasRenderingContext2DBase {
|
|
|
440
458
|
image = image.native;
|
|
441
459
|
}
|
|
442
460
|
if (args.length === 3) {
|
|
443
|
-
drawImage(image, args[1], args[2]);
|
|
461
|
+
this.context.drawImage(image, args[1], args[2]);
|
|
444
462
|
}
|
|
445
463
|
else if (args.length === 5) {
|
|
446
|
-
drawImage(image, args[1], args[2], args[3], args[4]);
|
|
464
|
+
this.context.drawImage(image, args[1], args[2], args[3], args[4]);
|
|
447
465
|
}
|
|
448
466
|
else if (args.length === 9) {
|
|
449
|
-
drawImage(image, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
|
|
467
|
+
this.context.drawImage(image, args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]);
|
|
450
468
|
}
|
|
451
469
|
}
|
|
452
470
|
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise = false) {
|
|
453
|
-
this.log('ellipse value:', x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
|
|
454
471
|
this._ensureLayoutBeforeDraw();
|
|
455
|
-
const ellipse = this._getMethod('ellipse');
|
|
456
|
-
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
|
|
472
|
+
//const ellipse = this._getMethod('ellipse');
|
|
473
|
+
this.context.ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
|
|
457
474
|
}
|
|
458
475
|
fill(...args) {
|
|
459
|
-
this.log('fill value:', ...args);
|
|
460
476
|
this._ensureLayoutBeforeDraw();
|
|
461
|
-
const fill = this._getMethod('fill');
|
|
477
|
+
//const fill = this.context.fill; //this._getMethod('fill');
|
|
462
478
|
if (typeof args[0] === 'string') {
|
|
463
|
-
fill(args[0]);
|
|
479
|
+
this.context.fill(args[0]);
|
|
464
480
|
}
|
|
465
481
|
else if (args[0] instanceof Path2D && typeof args[1] === 'string') {
|
|
466
|
-
fill(args[0].native, args[1]);
|
|
482
|
+
this.context.fill(args[0].native, args[1]);
|
|
467
483
|
}
|
|
468
484
|
else if (args[0] instanceof Path2D) {
|
|
469
|
-
fill(args[0].native);
|
|
485
|
+
this.context.fill(args[0].native);
|
|
470
486
|
}
|
|
471
487
|
else {
|
|
472
|
-
fill();
|
|
488
|
+
this.context.fill();
|
|
473
489
|
}
|
|
474
490
|
}
|
|
475
491
|
fillRect(x, y, width, height) {
|
|
476
|
-
this.log('fillRect value:', x, y, width, height);
|
|
477
492
|
this._ensureLayoutBeforeDraw();
|
|
478
|
-
const fillRect = this._getMethod('fillRect');
|
|
479
|
-
fillRect(x, y, width, height);
|
|
493
|
+
//const fillRect = this._getMethod('fillRect');
|
|
494
|
+
this.context.fillRect(x, y, width, height);
|
|
480
495
|
}
|
|
481
496
|
fillText(text, x, y, maxWidth) {
|
|
482
|
-
this.log('fillText value:', text, x, y, maxWidth);
|
|
483
497
|
this._ensureLayoutBeforeDraw();
|
|
484
|
-
const fillText = this._getMethod('fillText');
|
|
498
|
+
//const fillText = this.context.fillText; //this._getMethod('fillText');
|
|
485
499
|
if (typeof maxWidth === 'number') {
|
|
486
|
-
fillText(text + '', x, y, maxWidth);
|
|
500
|
+
this.context.fillText(text + '', x, y, maxWidth);
|
|
487
501
|
}
|
|
488
502
|
else {
|
|
489
|
-
fillText(text + '', x, y);
|
|
503
|
+
this.context.fillText(text + '', x, y);
|
|
490
504
|
}
|
|
491
505
|
}
|
|
492
506
|
getImageData(sx, sy, sw, sh) {
|
|
493
|
-
this.log('getImageData value:', sx, sy, sw, sh);
|
|
494
507
|
this._ensureLayoutBeforeDraw();
|
|
495
|
-
const getImageData = this._getMethod('getImageData');
|
|
496
|
-
return ImageData.fromNative(getImageData(sx, sy, sw, sh));
|
|
508
|
+
//const getImageData = this._getMethod('getImageData');
|
|
509
|
+
return ImageData.fromNative(this.context.getImageData(sx, sy, sw, sh));
|
|
497
510
|
}
|
|
498
511
|
getLineDash() {
|
|
499
|
-
this.log('getLineDash');
|
|
500
512
|
this._ensureLayoutBeforeDraw();
|
|
501
|
-
const getLineDash = this._getMethod('getLineDash');
|
|
502
|
-
return getLineDash();
|
|
513
|
+
//const getLineDash = this._getMethod('getLineDash');
|
|
514
|
+
return this.context.getLineDash();
|
|
503
515
|
}
|
|
504
516
|
isPointInPath(...args) {
|
|
505
|
-
this.log('isPointInPath value:', ...args);
|
|
506
517
|
this._ensureLayoutBeforeDraw();
|
|
507
|
-
const isPointInPath = this._getMethod('isPointInPath');
|
|
518
|
+
//const isPointInPath = this.context.isPointInPath; //this._getMethod('isPointInPath');
|
|
508
519
|
if (args.length === 2) {
|
|
509
|
-
return isPointInPath(args[0], args[1]);
|
|
520
|
+
return this.context.isPointInPath(args[0], args[1]);
|
|
510
521
|
}
|
|
511
522
|
else if (args.length === 3) {
|
|
512
|
-
return isPointInPath(args[0], args[1], args[2]);
|
|
523
|
+
return this.context.isPointInPath(args[0], args[1], args[2]);
|
|
513
524
|
}
|
|
514
525
|
else if (args.length === 4 && args[0] instanceof Path2D) {
|
|
515
|
-
return isPointInPath(args[0].native, args[1], args[2], args[3]);
|
|
526
|
+
return this.context.isPointInPath(args[0].native, args[1], args[2], args[3]);
|
|
516
527
|
}
|
|
517
528
|
return false;
|
|
518
529
|
}
|
|
519
530
|
isPointInStroke(...args) {
|
|
520
|
-
this.log('isPointInStroke value:', ...args);
|
|
521
531
|
this._ensureLayoutBeforeDraw();
|
|
522
|
-
const isPointInStroke = this._getMethod('isPointInStroke');
|
|
532
|
+
//const isPointInStroke = this.context.isPointInStroke; // this._getMethod('isPointInStroke');
|
|
523
533
|
if (args.length === 2) {
|
|
524
|
-
return isPointInStroke(args[0], args[1]);
|
|
534
|
+
return this.context.isPointInStroke(args[0], args[1]);
|
|
525
535
|
}
|
|
526
536
|
else if (args.length === 3 && args[0] instanceof Path2D) {
|
|
527
|
-
return isPointInStroke(args[0].native, args[1], args[2]);
|
|
537
|
+
return this.context.isPointInStroke(args[0].native, args[1], args[2]);
|
|
528
538
|
}
|
|
529
539
|
return false;
|
|
530
540
|
}
|
|
531
541
|
lineTo(x, y) {
|
|
532
|
-
this.log('lineTo value:', x, y);
|
|
533
542
|
this._ensureLayoutBeforeDraw();
|
|
534
|
-
const lineTo = this._getMethod('lineTo');
|
|
535
|
-
lineTo(x, y);
|
|
543
|
+
//const lineTo = this._getMethod('lineTo');
|
|
544
|
+
this.context.lineTo(x, y);
|
|
536
545
|
}
|
|
537
546
|
measureText(text) {
|
|
538
|
-
this.log('measureText value:', text);
|
|
539
547
|
this._ensureLayoutBeforeDraw();
|
|
540
|
-
const measureText = this._getMethod('measureText');
|
|
541
|
-
return new TextMetrics(measureText(text));
|
|
548
|
+
//const measureText = this._getMethod('measureText');
|
|
549
|
+
return new TextMetrics(this.context.measureText(text));
|
|
542
550
|
}
|
|
543
551
|
moveTo(x, y) {
|
|
544
|
-
this.log('moveTo value:', x, y);
|
|
545
552
|
this._ensureLayoutBeforeDraw();
|
|
546
|
-
const moveTo = this._getMethod('moveTo');
|
|
547
|
-
moveTo(x, y);
|
|
553
|
+
//const moveTo = this._getMethod('moveTo');
|
|
554
|
+
this.context.moveTo(x, y);
|
|
548
555
|
}
|
|
549
556
|
putImageData(...args) {
|
|
550
|
-
this.log('putImageData value:', ...args);
|
|
551
557
|
this._ensureLayoutBeforeDraw();
|
|
552
558
|
if (!args) {
|
|
553
559
|
return;
|
|
554
560
|
}
|
|
555
|
-
const putImageData = this._getMethod('putImageData');
|
|
561
|
+
//const putImageData = this.context.putImageData; //this._getMethod('putImageData');
|
|
556
562
|
let data = args[0];
|
|
557
563
|
if (args.length === 3) {
|
|
558
|
-
putImageData(data.native, args[1], args[2]);
|
|
564
|
+
this.context.putImageData(data.native, args[1], args[2]);
|
|
559
565
|
}
|
|
560
566
|
else if (args.length === 7) {
|
|
561
|
-
putImageData(data.native, args[1], args[2], args[3], args[4], args[5], args[6]);
|
|
567
|
+
this.context.putImageData(data.native, args[1], args[2], args[3], args[4], args[5], args[6]);
|
|
562
568
|
}
|
|
563
569
|
}
|
|
564
570
|
quadraticCurveTo(cpx, cpy, x, y) {
|
|
565
|
-
this.log('quadraticCurveTo value:', cpx, cpy, x, y);
|
|
566
571
|
this._ensureLayoutBeforeDraw();
|
|
567
|
-
const quadraticCurveTo = this._getMethod('quadraticCurveTo');
|
|
568
|
-
quadraticCurveTo(cpx, cpy, x, y);
|
|
572
|
+
//const quadraticCurveTo = this._getMethod('quadraticCurveTo');
|
|
573
|
+
this.context.quadraticCurveTo(cpx, cpy, x, y);
|
|
569
574
|
}
|
|
570
575
|
rect(x, y, width, height) {
|
|
571
|
-
this.log('rect value:', x, y, width, height);
|
|
572
576
|
this._ensureLayoutBeforeDraw();
|
|
573
|
-
const rect = this._getMethod('rect');
|
|
574
|
-
rect(x, y, width, height);
|
|
577
|
+
//const rect = this._getMethod('rect');
|
|
578
|
+
this.context.rect(x, y, width, height);
|
|
579
|
+
}
|
|
580
|
+
roundRect(x, y, width, height, radii) {
|
|
581
|
+
this._ensureLayoutBeforeDraw();
|
|
582
|
+
//const roundRect = this._getMethod('roundRect');
|
|
583
|
+
this.context.roundRect(x, y, width, height, radii);
|
|
575
584
|
}
|
|
576
585
|
removeHitRegion(id) { }
|
|
577
586
|
resetTransform() {
|
|
578
|
-
this.log('resetTransform value:');
|
|
579
587
|
this._ensureLayoutBeforeDraw();
|
|
580
|
-
const resetTransform = this._getMethod('resetTransform');
|
|
581
|
-
resetTransform();
|
|
588
|
+
//const resetTransform = this._getMethod('resetTransform');
|
|
589
|
+
this.context.resetTransform();
|
|
582
590
|
}
|
|
583
591
|
restore() {
|
|
584
|
-
this.log('restore');
|
|
585
592
|
this._ensureLayoutBeforeDraw();
|
|
586
|
-
const restore = this._getMethod('restore');
|
|
587
|
-
restore();
|
|
593
|
+
//const restore = this._getMethod('restore');
|
|
594
|
+
this.context.restore();
|
|
588
595
|
}
|
|
589
596
|
rotate(angle) {
|
|
590
|
-
this.log('rotate value:', angle);
|
|
591
597
|
this._ensureLayoutBeforeDraw();
|
|
592
|
-
const rotate = this._getMethod('rotate');
|
|
593
|
-
rotate(angle);
|
|
598
|
+
//const rotate = this._getMethod('rotate');
|
|
599
|
+
this.context.rotate(angle);
|
|
594
600
|
}
|
|
595
601
|
save() {
|
|
596
|
-
this.log('save');
|
|
597
602
|
this._ensureLayoutBeforeDraw();
|
|
598
|
-
const save = this._getMethod('save');
|
|
599
|
-
save();
|
|
603
|
+
//const save = this._getMethod('save');
|
|
604
|
+
this.context.save();
|
|
600
605
|
}
|
|
601
606
|
scale(x, y) {
|
|
602
|
-
this.log('scale value:', x, y);
|
|
603
607
|
this._ensureLayoutBeforeDraw();
|
|
604
|
-
const scale = this._getMethod('scale');
|
|
605
|
-
scale(x, y);
|
|
608
|
+
//const scale = this._getMethod('scale');
|
|
609
|
+
this.context.scale(x, y);
|
|
606
610
|
}
|
|
607
611
|
scrollPathIntoView(path) { }
|
|
608
612
|
setLineDash(segments) {
|
|
609
|
-
this.log('setLineDash value:', segments);
|
|
610
613
|
this._ensureLayoutBeforeDraw();
|
|
611
|
-
const setLineDash = this._getMethod('setLineDash');
|
|
612
|
-
setLineDash(segments);
|
|
614
|
+
//const setLineDash = this._getMethod('setLineDash');
|
|
615
|
+
this.context.setLineDash(segments);
|
|
613
616
|
}
|
|
614
617
|
setTransform(a, b, c, d, e, f) {
|
|
615
|
-
this.log('setTransform value:', a, b, c, d, e, f);
|
|
616
618
|
this._ensureLayoutBeforeDraw();
|
|
617
|
-
const setTransform = this._getMethod('setTransform');
|
|
618
|
-
setTransform(a, b, c, d, e, f);
|
|
619
|
+
//const setTransform = this._getMethod('setTransform');
|
|
620
|
+
this.context.setTransform(a, b, c, d, e, f);
|
|
619
621
|
}
|
|
620
622
|
stroke(path) {
|
|
621
|
-
this.log('stroke value:', path);
|
|
622
623
|
this._ensureLayoutBeforeDraw();
|
|
623
|
-
const stroke = this._getMethod('stroke');
|
|
624
|
+
//const stroke = this.context.stroke; //this._getMethod('stroke');
|
|
624
625
|
if (path) {
|
|
625
|
-
stroke(path.native);
|
|
626
|
+
this.context.stroke(path.native);
|
|
626
627
|
}
|
|
627
628
|
else {
|
|
628
|
-
stroke();
|
|
629
|
+
this.context.stroke();
|
|
629
630
|
}
|
|
630
631
|
}
|
|
631
632
|
strokeRect(x, y, width, height) {
|
|
632
|
-
this.log('strokeRect value:', x, y, width, height);
|
|
633
633
|
this._ensureLayoutBeforeDraw();
|
|
634
|
-
const strokeRect = this._getMethod('strokeRect');
|
|
635
|
-
strokeRect(x, y, width, height);
|
|
634
|
+
//const strokeRect = this._getMethod('strokeRect');
|
|
635
|
+
this.context.strokeRect(x, y, width, height);
|
|
636
636
|
}
|
|
637
637
|
strokeText(text, x, y, maxWidth) {
|
|
638
|
-
this.log('strokeText value:', text, x, y, maxWidth);
|
|
639
638
|
this._ensureLayoutBeforeDraw();
|
|
640
|
-
const strokeText = this._getMethod('strokeText');
|
|
639
|
+
//const strokeText = this.context.strokeText; //this._getMethod('strokeText');
|
|
641
640
|
if (typeof maxWidth === 'number') {
|
|
642
|
-
strokeText(text + '', x, y, maxWidth);
|
|
641
|
+
this.context.strokeText(text + '', x, y, maxWidth);
|
|
643
642
|
}
|
|
644
643
|
else {
|
|
645
|
-
strokeText(text + '', x, y);
|
|
644
|
+
this.context.strokeText(text + '', x, y);
|
|
646
645
|
}
|
|
647
646
|
}
|
|
648
647
|
transform(a, b, c, d, e, f) {
|
|
649
|
-
this.log('transform value:', a, b, c, d, e, f);
|
|
650
648
|
this._ensureLayoutBeforeDraw();
|
|
651
|
-
const transform = this._getMethod('transform');
|
|
652
|
-
transform(a, b, c, d, e, f);
|
|
649
|
+
//const transform = this._getMethod('transform');
|
|
650
|
+
this.context.transform(a, b, c, d, e, f);
|
|
653
651
|
}
|
|
654
652
|
translate(x, y) {
|
|
655
|
-
this.log('translate value:', x, y);
|
|
656
653
|
this._ensureLayoutBeforeDraw();
|
|
657
|
-
const translate = this._getMethod('translate');
|
|
658
|
-
translate(x, y);
|
|
654
|
+
//const translate = this._getMethod('translate');
|
|
655
|
+
this.context.translate(x, y);
|
|
659
656
|
}
|
|
660
657
|
_ensureLayoutBeforeDraw() {
|
|
661
|
-
if (this.canvas) {
|
|
658
|
+
if (this.canvas !== undefined) {
|
|
662
659
|
this.canvas._layoutNative();
|
|
663
660
|
}
|
|
664
661
|
}
|
|
665
|
-
log(message, ...args) {
|
|
666
|
-
if (!CanvasRenderingContext2D.isDebug) {
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
669
|
-
console.log(message, args);
|
|
670
|
-
}
|
|
671
662
|
}
|
|
672
|
-
CanvasRenderingContext2D.isDebug =
|
|
663
|
+
CanvasRenderingContext2D.isDebug = true;
|
|
673
664
|
(() => {
|
|
674
665
|
Helpers.initialize();
|
|
675
666
|
//ctor = global.CanvasJSIModule.create2DContext;
|
|
676
|
-
ctor = global.
|
|
667
|
+
ctor = global.CanvasModule.create2DContextWithPointer;
|
|
677
668
|
})();
|
|
678
|
-
//# sourceMappingURL=index.
|
|
669
|
+
//# sourceMappingURL=index.js.map
|