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