@shopify/react-native-skia 0.1.230 → 0.1.232
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +1 -0
- package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp +2 -2
- package/cpp/api/JsiSkAnimatedImage.h +1 -1
- package/cpp/api/JsiSkDataFactory.h +6 -6
- package/cpp/api/JsiSkImage.h +4 -4
- package/cpp/api/JsiSkPath.h +1 -1
- package/cpp/api/JsiSkRRect.h +30 -3
- package/cpp/api/third_party/base64.cpp +153 -0
- package/cpp/api/third_party/base64.h +50 -0
- package/cpp/jsi/JsiPromises.h +1 -1
- package/cpp/rnskia/dom/props/FontProp.h +2 -4
- package/cpp/rnskia/dom/props/RRectProp.h +50 -0
- package/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +2 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +1 -1
- package/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +3 -3
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Text.js +1 -11
- package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -1
- package/lib/commonjs/dom/types/Common.d.ts +2 -2
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +1 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/headless/index.d.ts +3 -1
- package/lib/commonjs/headless/index.js +12 -6
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/skia/types/Canvas.d.ts +4 -4
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +5 -0
- package/lib/commonjs/skia/types/Matrix4.js +8 -3
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
- package/lib/commonjs/skia/types/Paragraph/Paragraph.d.ts +2 -2
- package/lib/commonjs/skia/types/Paragraph/Paragraph.js.map +1 -1
- package/lib/commonjs/skia/types/Paragraph/ParagraphStyle.d.ts +6 -6
- package/lib/commonjs/skia/types/Paragraph/ParagraphStyle.js +25 -25
- package/lib/commonjs/skia/types/Paragraph/ParagraphStyle.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.d.ts +2 -2
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/RRect.d.ts +9 -0
- package/lib/commonjs/skia/types/RRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +4 -4
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkParagraphStyle.js +1 -1
- package/lib/commonjs/skia/web/JsiSkParagraphStyle.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkRRect.js +4 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/commonjs/web/LoadSkiaWeb.js +4 -1
- package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +2 -1
- package/lib/module/dom/nodes/datatypes/Rect.d.ts +1 -1
- package/lib/module/dom/nodes/drawings/RRectNode.d.ts +3 -3
- package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Text.js +1 -11
- package/lib/module/dom/nodes/drawings/Text.js.map +1 -1
- package/lib/module/dom/types/Common.d.ts +2 -2
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +1 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/headless/index.d.ts +3 -1
- package/lib/module/headless/index.js +5 -3
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/skia/types/Canvas.d.ts +4 -4
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +5 -0
- package/lib/module/skia/types/Matrix4.js +6 -4
- package/lib/module/skia/types/Matrix4.js.map +1 -1
- package/lib/module/skia/types/Paragraph/Paragraph.d.ts +2 -2
- package/lib/module/skia/types/Paragraph/Paragraph.js.map +1 -1
- package/lib/module/skia/types/Paragraph/ParagraphStyle.d.ts +6 -6
- package/lib/module/skia/types/Paragraph/ParagraphStyle.js +21 -21
- package/lib/module/skia/types/Paragraph/ParagraphStyle.js.map +1 -1
- package/lib/module/skia/types/Path/Path.d.ts +2 -2
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/RRect.d.ts +9 -0
- package/lib/module/skia/types/RRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +4 -4
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraphStyle.js +2 -2
- package/lib/module/skia/web/JsiSkParagraphStyle.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.d.ts +2 -2
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.d.ts +2 -2
- package/lib/module/skia/web/JsiSkRRect.js +4 -0
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/web/LoadSkiaWeb.js +5 -1
- package/lib/module/web/LoadSkiaWeb.js.map +1 -1
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +2 -1
- package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +3 -3
- package/lib/typescript/src/dom/types/Common.d.ts +2 -2
- package/lib/typescript/src/dom/types/Drawings.d.ts +1 -1
- package/lib/typescript/src/headless/index.d.ts +3 -1
- package/lib/typescript/src/skia/types/Canvas.d.ts +4 -4
- package/lib/typescript/src/skia/types/Matrix4.d.ts +5 -0
- package/lib/typescript/src/skia/types/Paragraph/Paragraph.d.ts +2 -2
- package/lib/typescript/src/skia/types/Paragraph/ParagraphStyle.d.ts +6 -6
- package/lib/typescript/src/skia/types/Path/Path.d.ts +2 -2
- package/lib/typescript/src/skia/types/RRect.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +4 -4
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +2 -2
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskottie.xcframework/Info.plist +5 -5
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +5 -5
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +1 -1
- package/src/dom/nodes/drawings/RRectNode.ts +2 -2
- package/src/dom/nodes/drawings/Text.ts +1 -14
- package/src/dom/types/Common.ts +2 -1
- package/src/dom/types/Drawings.ts +1 -1
- package/src/headless/index.ts +7 -3
- package/src/skia/types/Canvas.ts +4 -4
- package/src/skia/types/Matrix4.ts +8 -6
- package/src/skia/types/Paragraph/Paragraph.ts +2 -2
- package/src/skia/types/Paragraph/ParagraphStyle.ts +6 -6
- package/src/skia/types/Path/Path.ts +2 -2
- package/src/skia/types/RRect.ts +11 -0
- package/src/skia/web/JsiSkCanvas.ts +4 -4
- package/src/skia/web/JsiSkParagraphStyle.ts +2 -2
- package/src/skia/web/JsiSkPath.ts +2 -2
- package/src/skia/web/JsiSkRRect.ts +23 -2
- package/src/web/LoadSkiaWeb.tsx +4 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getEnum","HostObject","JsiSkPaint","JsiSkRect","JsiSkRRect","JsiSkImage","JsiSkVertices","JsiSkPath","JsiSkFont","JsiSkTextBlob","JsiSkPicture","JsiSkMatrix","JsiSkImageFilter","JsiSkPoint","JsiSkCanvas","constructor","CanvasKit","ref","delete","drawRect","rect","paint","fromValue","drawImage","image","x","y","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","FilterMode","MipmapMode","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","BlendMode","drawPatch","cubics","colors","texs","map","flat","flatMap","p","undefined","restoreToCount","saveCount","drawPoints","points","PointMode","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","drawDRRect","outer","inner","drawOval","drawPath","path","drawText","str","font","drawTextBlob","blob","drawGlyphs","glyphs","positions","drawSvg","_svgDom","_width","_height","Error","save","saveLayer","bounds","backdrop","flags","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","PathOp","clipRect","clipRRect","concat","m","isArray","drawPicture","skp","readPixels","srcX","srcY","imageInfo","pxInfo","width","height","colorSpace","ColorSpace","SRGB","alphaType","AlphaType","colorType","ColorType"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type { Canvas, CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n ClipOp,\n FilterMode,\n MipmapMode,\n PointMode,\n SaveLayerFlag,\n ImageInfo,\n SkCanvas,\n SkColor,\n SkFont,\n SkImage,\n SkImageFilter,\n SkMatrix,\n SkPaint,\n SkPath,\n SkPicture,\n SkPoint,\n SkRect,\n SkRRect,\n SkSVG,\n SkTextBlob,\n SkVertices,\n} from \"../types\";\n\nimport { getEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkCanvas\n extends HostObject<Canvas, \"Canvas\">\n implements SkCanvas\n{\n constructor(CanvasKit: CanvasKit, ref: Canvas) {\n super(CanvasKit, ref, \"Canvas\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n drawRect(rect: SkRect, paint: SkPaint) {\n this.ref.drawRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n this.ref.drawImage(\n JsiSkImage.fromValue(image),\n x,\n y,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRect(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n paint: SkPaint,\n fastSample?: boolean\n ) {\n this.ref.drawImageRect(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n JsiSkPaint.fromValue(paint),\n fastSample\n );\n }\n\n drawImageCubic(\n img: SkImage,\n left: number,\n top: number,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageCubic(\n JsiSkImage.fromValue(img),\n left,\n top,\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageOptions(\n img: SkImage,\n left: number,\n top: number,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageOptions(\n JsiSkImage.fromValue(img),\n left,\n top,\n getEnum(this.CanvasKit.FilterMode, fm),\n getEnum(this.CanvasKit.MipmapMode, mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageNine(\n img: SkImage,\n center: SkRect,\n dest: SkRect,\n filter: FilterMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageNine(\n JsiSkImage.fromValue(img),\n Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n getEnum(this.CanvasKit.FilterMode, filter),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectCubic(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectCubic(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectOptions(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectOptions(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n getEnum(this.CanvasKit.FilterMode, fm),\n getEnum(this.CanvasKit.MipmapMode, mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawPaint(paint: SkPaint) {\n this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n }\n\n drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n }\n\n drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n }\n\n drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n this.ref.drawVertices(\n JsiSkVertices.fromValue(verts),\n getEnum(this.CanvasKit.BlendMode, mode),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPatch(\n cubics: SkPoint[],\n colors?: SkColor[] | null,\n texs?: SkPoint[] | null,\n mode?: BlendMode | null,\n paint?: SkPaint\n ) {\n this.ref.drawPatch(\n cubics.map(({ x, y }) => [x, y]).flat(),\n colors,\n texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n mode ? getEnum(this.CanvasKit.BlendMode, mode) : null,\n paint ? JsiSkPaint.fromValue(paint) : undefined\n );\n }\n\n restoreToCount(saveCount: number) {\n this.ref.restoreToCount(saveCount);\n }\n\n drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n this.ref.drawPoints(\n getEnum(this.CanvasKit.PointMode, mode),\n points.map(({ x, y }) => [x, y]).flat(),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawArc(\n oval: SkRect,\n startAngle: number,\n sweepAngle: number,\n useCenter: boolean,\n paint: SkPaint\n ) {\n this.ref.drawArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngle,\n sweepAngle,\n useCenter,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawRRect(rrect: SkRRect, paint: SkPaint) {\n this.ref.drawRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawDRRect(outer: SkRRect, inner: SkRRect, paint: SkPaint) {\n this.ref.drawDRRect(\n JsiSkRRect.fromValue(this.CanvasKit, outer),\n JsiSkRRect.fromValue(this.CanvasKit, inner),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawOval(oval: SkRect, paint: SkPaint) {\n this.ref.drawOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPath(path: SkPath, paint: SkPaint) {\n this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n }\n\n drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n this.ref.drawText(\n str,\n x,\n y,\n JsiSkPaint.fromValue(paint),\n JsiSkFont.fromValue(font)\n );\n }\n\n drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n this.ref.drawTextBlob(\n JsiSkTextBlob.fromValue(blob),\n x,\n y,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawGlyphs(\n glyphs: number[],\n positions: SkPoint[],\n x: number,\n y: number,\n font: SkFont,\n paint: SkPaint\n ) {\n this.ref.drawGlyphs(\n glyphs,\n positions.map((p) => [p.x, p.y]).flat(),\n x,\n y,\n JsiSkFont.fromValue(font),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawSvg(_svgDom: SkSVG, _width?: number, _height?: number) {\n throw new Error(\"drawSvg is not implemented on React Native Web\");\n }\n\n save() {\n return this.ref.save();\n }\n\n saveLayer(\n paint?: SkPaint,\n bounds?: SkRect | null,\n backdrop?: SkImageFilter | null,\n flags?: SaveLayerFlag\n ) {\n return this.ref.saveLayer(\n paint ? JsiSkPaint.fromValue(paint) : undefined,\n bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n flags\n );\n }\n\n restore() {\n this.ref.restore();\n }\n\n rotate(rotationInDegrees: number, rx: number, ry: number) {\n this.ref.rotate(rotationInDegrees, rx, ry);\n }\n\n scale(sx: number, sy: number) {\n this.ref.scale(sx, sy);\n }\n\n skew(sx: number, sy: number) {\n this.ref.skew(sx, sy);\n }\n\n translate(dx: number, dy: number) {\n this.ref.translate(dx, dy);\n }\n\n drawColor(color: SkColor, blendMode?: BlendMode) {\n this.ref.drawColor(\n color,\n blendMode ? getEnum(this.CanvasKit.BlendMode, blendMode) : undefined\n );\n }\n\n clear(color: SkColor) {\n this.ref.clear(color);\n }\n\n clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipPath(\n JsiSkPath.fromValue(path),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n concat(m: SkMatrix | number[]) {\n this.ref.concat(Array.isArray(m) ? m : JsiSkMatrix.fromValue(m));\n }\n\n drawPicture(skp: SkPicture) {\n this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n }\n\n readPixels(srcX: number, srcY: number, imageInfo: ImageInfo) {\n const pxInfo = {\n width: imageInfo.width,\n height: imageInfo.height,\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n alphaType: getEnum(this.CanvasKit.AlphaType, imageInfo.alphaType),\n colorType: getEnum(this.CanvasKit.ColorType, imageInfo.colorType),\n };\n return this.ref.readPixels(srcX, srcY, pxInfo);\n }\n}\n"],"mappings":";;AA2BA,SAASA,OAAT,EAAkBC,UAAlB,QAAoC,QAApC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,OAAO,MAAMC,WAAN,SACGb,UADH,CAGP;EACEc,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAoC;IAC7C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IAD6C,iCAIrC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN8C;EAE9C;;EAMDC,QAAQ,CAACC,IAAD,EAAeC,KAAf,EAA+B;IACrC,KAAKJ,GAAL,CAASE,QAAT,CACEhB,SAAS,CAACmB,SAAV,CAAoB,KAAKN,SAAzB,EAAoCI,IAApC,CADF,EAEElB,UAAU,CAACoB,SAAX,CAAqBD,KAArB,CAFF;EAID;;EAEDE,SAAS,CAACC,KAAD,EAAiBC,CAAjB,EAA4BC,CAA5B,EAAuCL,KAAvC,EAAwD;IAC/D,KAAKJ,GAAL,CAASM,SAAT,CACElB,UAAU,CAACiB,SAAX,CAAqBE,KAArB,CADF,EAEEC,CAFF,EAGEC,CAHF,EA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lob","JsiSkPicture","JsiSkMatrix","JsiSkImageFilter","JsiSkPoint","JsiSkCanvas","constructor","CanvasKit","ref","delete","drawRect","rect","paint","fromValue","drawImage","image","x","y","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","FilterMode","MipmapMode","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","BlendMode","drawPatch","cubics","colors","texs","map","flat","flatMap","p","undefined","restoreToCount","saveCount","drawPoints","points","PointMode","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","drawDRRect","outer","inner","drawOval","drawPath","path","drawText","str","font","drawTextBlob","blob","drawGlyphs","glyphs","positions","drawSvg","_svgDom","_width","_height","Error","save","saveLayer","bounds","backdrop","flags","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","PathOp","clipRect","clipRRect","concat","m","isArray","drawPicture","skp","readPixels","srcX","srcY","imageInfo","pxInfo","width","height","colorSpace","ColorSpace","SRGB","alphaType","AlphaType","colorType","ColorType"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type { Canvas, CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n ClipOp,\n FilterMode,\n MipmapMode,\n PointMode,\n SaveLayerFlag,\n ImageInfo,\n SkCanvas,\n SkColor,\n SkFont,\n SkImage,\n SkImageFilter,\n SkMatrix,\n SkPaint,\n SkPath,\n SkPicture,\n SkPoint,\n SkRect,\n InputRRect,\n SkSVG,\n SkTextBlob,\n SkVertices,\n} from \"../types\";\n\nimport { getEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkCanvas\n extends HostObject<Canvas, \"Canvas\">\n implements SkCanvas\n{\n constructor(CanvasKit: CanvasKit, ref: Canvas) {\n super(CanvasKit, ref, \"Canvas\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n drawRect(rect: SkRect, paint: SkPaint) {\n this.ref.drawRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n this.ref.drawImage(\n JsiSkImage.fromValue(image),\n x,\n y,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRect(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n paint: SkPaint,\n fastSample?: boolean\n ) {\n this.ref.drawImageRect(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n JsiSkPaint.fromValue(paint),\n fastSample\n );\n }\n\n drawImageCubic(\n img: SkImage,\n left: number,\n top: number,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageCubic(\n JsiSkImage.fromValue(img),\n left,\n top,\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageOptions(\n img: SkImage,\n left: number,\n top: number,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageOptions(\n JsiSkImage.fromValue(img),\n left,\n top,\n getEnum(this.CanvasKit.FilterMode, fm),\n getEnum(this.CanvasKit.MipmapMode, mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageNine(\n img: SkImage,\n center: SkRect,\n dest: SkRect,\n filter: FilterMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageNine(\n JsiSkImage.fromValue(img),\n Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n getEnum(this.CanvasKit.FilterMode, filter),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectCubic(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectCubic(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectOptions(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectOptions(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n getEnum(this.CanvasKit.FilterMode, fm),\n getEnum(this.CanvasKit.MipmapMode, mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawPaint(paint: SkPaint) {\n this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n }\n\n drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n }\n\n drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n }\n\n drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n this.ref.drawVertices(\n JsiSkVertices.fromValue(verts),\n getEnum(this.CanvasKit.BlendMode, mode),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPatch(\n cubics: SkPoint[],\n colors?: SkColor[] | null,\n texs?: SkPoint[] | null,\n mode?: BlendMode | null,\n paint?: SkPaint\n ) {\n this.ref.drawPatch(\n cubics.map(({ x, y }) => [x, y]).flat(),\n colors,\n texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n mode ? getEnum(this.CanvasKit.BlendMode, mode) : null,\n paint ? JsiSkPaint.fromValue(paint) : undefined\n );\n }\n\n restoreToCount(saveCount: number) {\n this.ref.restoreToCount(saveCount);\n }\n\n drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n this.ref.drawPoints(\n getEnum(this.CanvasKit.PointMode, mode),\n points.map(({ x, y }) => [x, y]).flat(),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawArc(\n oval: SkRect,\n startAngle: number,\n sweepAngle: number,\n useCenter: boolean,\n paint: SkPaint\n ) {\n this.ref.drawArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngle,\n sweepAngle,\n useCenter,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawRRect(rrect: InputRRect, paint: SkPaint) {\n this.ref.drawRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawDRRect(outer: InputRRect, inner: InputRRect, paint: SkPaint) {\n this.ref.drawDRRect(\n JsiSkRRect.fromValue(this.CanvasKit, outer),\n JsiSkRRect.fromValue(this.CanvasKit, inner),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawOval(oval: SkRect, paint: SkPaint) {\n this.ref.drawOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPath(path: SkPath, paint: SkPaint) {\n this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n }\n\n drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n this.ref.drawText(\n str,\n x,\n y,\n JsiSkPaint.fromValue(paint),\n JsiSkFont.fromValue(font)\n );\n }\n\n drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n this.ref.drawTextBlob(\n JsiSkTextBlob.fromValue(blob),\n x,\n y,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawGlyphs(\n glyphs: number[],\n positions: SkPoint[],\n x: number,\n y: number,\n font: SkFont,\n paint: SkPaint\n ) {\n this.ref.drawGlyphs(\n glyphs,\n positions.map((p) => [p.x, p.y]).flat(),\n x,\n y,\n JsiSkFont.fromValue(font),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawSvg(_svgDom: SkSVG, _width?: number, _height?: number) {\n throw new Error(\"drawSvg is not implemented on React Native Web\");\n }\n\n save() {\n return this.ref.save();\n }\n\n saveLayer(\n paint?: SkPaint,\n bounds?: SkRect | null,\n backdrop?: SkImageFilter | null,\n flags?: SaveLayerFlag\n ) {\n return this.ref.saveLayer(\n paint ? JsiSkPaint.fromValue(paint) : undefined,\n bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n flags\n );\n }\n\n restore() {\n this.ref.restore();\n }\n\n rotate(rotationInDegrees: number, rx: number, ry: number) {\n this.ref.rotate(rotationInDegrees, rx, ry);\n }\n\n scale(sx: number, sy: number) {\n this.ref.scale(sx, sy);\n }\n\n skew(sx: number, sy: number) {\n this.ref.skew(sx, sy);\n }\n\n translate(dx: number, dy: number) {\n this.ref.translate(dx, dy);\n }\n\n drawColor(color: SkColor, blendMode?: BlendMode) {\n this.ref.drawColor(\n color,\n blendMode ? getEnum(this.CanvasKit.BlendMode, blendMode) : undefined\n );\n }\n\n clear(color: SkColor) {\n this.ref.clear(color);\n }\n\n clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipPath(\n JsiSkPath.fromValue(path),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n clipRRect(rrect: InputRRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n concat(m: SkMatrix | number[]) {\n this.ref.concat(Array.isArray(m) ? m : JsiSkMatrix.fromValue(m));\n }\n\n drawPicture(skp: SkPicture) {\n this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n }\n\n readPixels(srcX: number, srcY: number, imageInfo: ImageInfo) {\n const pxInfo = {\n width: imageInfo.width,\n height: imageInfo.height,\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n alphaType: getEnum(this.CanvasKit.AlphaType, imageInfo.alphaType),\n colorType: getEnum(this.CanvasKit.ColorType, imageInfo.colorType),\n };\n return this.ref.readPixels(srcX, srcY, pxInfo);\n }\n}\n"],"mappings":";;AA2BA,SAASA,OAAT,EAAkBC,UAAlB,QAAoC,QAApC;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,UAAT,QAA2B,cAA3B;AAEA,OAAO,MAAMC,WAAN,SACGb,UADH,CAGP;EACEc,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAoC;IAC7C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB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E,KAAK9H,SAAL,CAAe+H,UAAf,CAA0BC,IAHzB;MAIbC,SAAS,EAAEjJ,OAAO,CAAC,KAAKgB,SAAL,CAAekI,SAAhB,EAA2BR,SAAS,CAACO,SAArC,CAJL;MAKbE,SAAS,EAAEnJ,OAAO,CAAC,KAAKgB,SAAL,CAAeoI,SAAhB,EAA2BV,SAAS,CAACS,SAArC;IALL,CAAf;IAOA,OAAO,KAAKlI,GAAL,CAASsH,UAAT,CAAoBC,IAApB,EAA0BC,IAA1B,EAAgCE,MAAhC,CAAP;EACD;;AA9VH"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { TextDirection } from "../types";
|
2
2
|
export class JsiSkParagraphStyle {
|
3
3
|
static toParagraphStyle(ck, value) {
|
4
4
|
var _value$disableHinting, _value$ellipsis, _value$heightMultipli, _value$maxLines, _value$replaceTabChar, _ps$strutStyle, _value$strutStyle$fon, _value$strutStyle, _value$strutStyle$fon2, _value$strutStyle2, _value$strutStyle$hei, _value$strutStyle3, _value$strutStyle$lea, _value$strutStyle4, _value$strutStyle$for, _value$strutStyle5, _ps$strutStyle$fontSt, _value$strutStyle6, _value$strutStyle6$fo, _value$strutStyle7, _value$strutStyle7$fo, _value$strutStyle8, _value$strutStyle8$fo, _value$strutStyle$hal, _value$strutStyle9, _value$strutStyle$str, _value$strutStyle10;
|
@@ -19,7 +19,7 @@ export class JsiSkParagraphStyle {
|
|
19
19
|
value: value.textAlign
|
20
20
|
} : undefined !== null && undefined !== void 0 ? undefined : ps.textAlign;
|
21
21
|
ps.textDirection = value.textDirection !== undefined ? {
|
22
|
-
value: value.textDirection ===
|
22
|
+
value: value.textDirection === TextDirection.LTR ? 1 : 0
|
23
23
|
} : ps.textDirection;
|
24
24
|
ps.textHeightBehavior = value.textHeightBehavior !== undefined ? {
|
25
25
|
value: value.textHeightBehavior
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["TextDirection","JsiSkParagraphStyle","toParagraphStyle","ck","value","ps","ParagraphStyle","textStyle","color","BLACK","disableHinting","ellipsis","heightMultiplier","maxLines","replaceTabCharacters","textAlign","undefined","textDirection","LTR","textHeightBehavior","strutStyle","fontFamilies","fontSize","leading","forceStrutHeight","fontStyle","slant","width","weight","halfLeading","strutEnabled"],"sources":["JsiSkParagraphStyle.ts"],"sourcesContent":["import type { CanvasKit, ParagraphStyle } from \"canvaskit-wasm\";\n\nimport { TextDirection, type SkParagraphStyle } from \"../types\";\n\nexport class JsiSkParagraphStyle {\n static toParagraphStyle(\n ck: CanvasKit,\n value: SkParagraphStyle\n ): ParagraphStyle {\n // Seems like we need to provide the textStyle.color value, otherwise\n // the constructor crashes.\n const ps = new ck.ParagraphStyle({ textStyle: { color: ck.BLACK } });\n\n ps.disableHinting = value.disableHinting ?? ps.disableHinting;\n ps.ellipsis = value.ellipsis ?? ps.ellipsis;\n ps.heightMultiplier = value.heightMultiplier ?? ps.heightMultiplier;\n ps.maxLines = value.maxLines ?? ps.maxLines;\n ps.replaceTabCharacters =\n value.replaceTabCharacters ?? ps.replaceTabCharacters;\n ps.textAlign =\n value.textAlign !== undefined\n ? { value: value.textAlign }\n : undefined ?? ps.textAlign;\n ps.textDirection =\n value.textDirection !== undefined\n ? { value: value.textDirection === TextDirection.LTR ? 1 : 0 }\n : ps.textDirection;\n ps.textHeightBehavior =\n value.textHeightBehavior !== undefined\n ? { value: value.textHeightBehavior }\n : ps.textHeightBehavior;\n\n ps.strutStyle = ps.strutStyle ?? {};\n ps.strutStyle.fontFamilies =\n value.strutStyle?.fontFamilies ?? ps.strutStyle.fontFamilies;\n ps.strutStyle.fontSize =\n value.strutStyle?.fontSize ?? ps.strutStyle.fontSize;\n ps.strutStyle.heightMultiplier =\n value.strutStyle?.heightMultiplier ?? ps.strutStyle.heightMultiplier;\n ps.strutStyle.leading = value.strutStyle?.leading ?? ps.strutStyle.leading;\n ps.strutStyle.forceStrutHeight =\n value.strutStyle?.forceStrutHeight ?? ps.strutStyle.forceStrutHeight;\n\n ps.strutStyle.fontStyle = ps.strutStyle.fontStyle ?? {};\n\n ps.strutStyle.fontStyle.slant =\n value.strutStyle?.fontStyle?.slant !== undefined\n ? { value: value.strutStyle.fontStyle.slant }\n : ps.strutStyle.fontStyle.slant;\n ps.strutStyle.fontStyle.width =\n value.strutStyle?.fontStyle?.width !== undefined\n ? { value: value.strutStyle.fontStyle.width }\n : ps.strutStyle.fontStyle.width;\n ps.strutStyle.fontStyle.weight =\n value.strutStyle?.fontStyle?.weight !== undefined\n ? { value: value.strutStyle.fontStyle.weight }\n : ps.strutStyle.fontStyle.weight;\n ps.strutStyle.halfLeading =\n value.strutStyle?.halfLeading ?? ps.strutStyle.halfLeading;\n ps.strutStyle.strutEnabled =\n value.strutStyle?.strutEnabled ?? ps.strutStyle.strutEnabled;\n\n return ps;\n }\n}\n"],"mappings":"AAEA,SAASA,aAAT,QAAqD,UAArD;AAEA,OAAO,MAAMC,mBAAN,CAA0B;EACR,OAAhBC,gBAAgB,CACrBC,EADqB,EAErBC,KAFqB,EAGL;IAAA;;IAChB;IACA;IACA,MAAMC,EAAE,GAAG,IAAIF,EAAE,CAACG,cAAP,CAAsB;MAAEC,SAAS,EAAE;QAAEC,KAAK,EAAEL,EAAE,CAACM;MAAZ;IAAb,CAAtB,CAAX;IAEAJ,EAAE,CAACK,cAAH,4BAAoBN,KAAK,CAACM,cAA1B,yEAA4CL,EAAE,CAACK,cAA/C;IACAL,EAAE,CAACM,QAAH,sBAAcP,KAAK,CAACO,QAApB,6DAAgCN,EAAE,CAACM,QAAnC;IACAN,EAAE,CAACO,gBAAH,4BAAsBR,KAAK,CAACQ,gBAA5B,yEAAgDP,EAAE,CAACO,gBAAnD;IACAP,EAAE,CAACQ,QAAH,sBAAcT,KAAK,CAACS,QAApB,6DAAgCR,EAAE,CAACQ,QAAnC;IACAR,EAAE,CAACS,oBAAH,4BACEV,KAAK,CAACU,oBADR,yEACgCT,EAAE,CAACS,oBADnC;IAEAT,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@ -1,5 +1,5 @@
|
|
1
1
|
import type { CanvasKit, Path } from "canvaskit-wasm";
|
2
|
-
import type { FillType, PathCommand, PathOp, SkMatrix, SkPath, SkPoint, SkRect,
|
2
|
+
import type { FillType, PathCommand, PathOp, SkMatrix, SkPath, SkPoint, SkRect, InputRRect, StrokeOpts } from "../types";
|
3
3
|
import { HostObject } from "./Host";
|
4
4
|
import { JsiSkPoint } from "./JsiSkPoint";
|
5
5
|
import { JsiSkRect } from "./JsiSkRect";
|
@@ -41,7 +41,7 @@ export declare class JsiSkPath extends HostObject<Path, "Path"> implements SkPat
|
|
41
41
|
getFillType(): number;
|
42
42
|
quadTo(x1: number, y1: number, x2: number, y2: number): this;
|
43
43
|
addRect(rect: SkRect, isCCW?: boolean): this;
|
44
|
-
addRRect(rrect:
|
44
|
+
addRRect(rrect: InputRRect, isCCW?: boolean): this;
|
45
45
|
getPoint(index: number): JsiSkPoint;
|
46
46
|
isEmpty(): boolean;
|
47
47
|
isVolatile(): boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["PathVerb","getEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","pinT","t","Math","min","max","JsiSkPath","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","FillType","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","StrokeJoin","cap","StrokeCap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","PathOp","simplify","toSVGString","trim","start","stop","isComplement","startT","stopT","transform","m3","isArray","interpolate","end","output","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { getEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst pinT = (t: number) => Math.min(Math.max(t, 0), 1);\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(getEnum(this.CanvasKit.FillType, fill));\n return this;\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n return this;\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(this.CanvasKit.StrokeJoin, opts.join),\n cap: optEnum(this.CanvasKit.StrokeCap, opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n return this;\n }\n\n reset() {\n this.ref.reset();\n return this;\n }\n\n rewind() {\n this.ref.rewind();\n return this;\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n return this;\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n return this;\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(\n JsiSkPath.fromValue(path),\n getEnum(this.CanvasKit.PathOp, op)\n );\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(start: number, stop: number, isComplement: boolean) {\n const startT = pinT(start);\n const stopT = pinT(stop);\n if (startT === 0 && stopT === 1) {\n return this;\n }\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(Array.isArray(m3) ? m3 : JsiSkMatrix.fromValue(m3));\n return this;\n }\n\n interpolate(end: SkPath, t: number, output?: SkPath) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n if (output) {\n (output as JsiSkPath).ref = path;\n return output;\n } else {\n return new JsiSkPath(this.CanvasKit, path);\n }\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,UAAzB;AAaA,SAASC,OAAT,EAAkBC,UAAlB,EAA8BC,OAA9B,QAA6C,QAA7C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,MAAMC,YAAY,GAAG;EACnB,CAACR,QAAQ,CAACS,IAAV,GAAiB,CADE;EAEnB,CAACT,QAAQ,CAACU,IAAV,GAAiB,CAFE;EAGnB,CAACV,QAAQ,CAACW,IAAV,GAAiB,CAHE;EAInB,CAACX,QAAQ,CAACY,KAAV,GAAkB,CAJC;EAKnB,CAACZ,QAAQ,CAACa,KAAV,GAAkB,CALC;EAMnB,CAACb,QAAQ,CAACc,KAAV,GAAkB;AANC,CAArB;;AASA,MAAMC,IAAI,GAAIC,CAAD,IAAeC,IAAI,CAACC,GAAL,CAASD,IAAI,CAACE,GAAL,CAASH,CAAT,EAAY,CAAZ,CAAT,EAAyB,CAAzB,CAA5B;;AAEA,OAAO,MAAMI,SAAN,SAAwBlB,UAAxB,CAAmE;EACxEmB,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAInC,MAAM;MACd,KAAKA,GA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,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAOpG,MAAP;EACD;;AA3WuE"}
|
1
|
+
{"version":3,"names":["PathVerb","getEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","pinT","t","Math","min","max","JsiSkPath","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","FillType","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","StrokeJoin","cap","StrokeCap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","PathOp","simplify","toSVGString","trim","start","stop","isComplement","startT","stopT","transform","m3","isArray","interpolate","end","output","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n InputRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { getEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst pinT = (t: number) => Math.min(Math.max(t, 0), 1);\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(getEnum(this.CanvasKit.FillType, fill));\n return this;\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n return this;\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(this.CanvasKit.StrokeJoin, opts.join),\n cap: optEnum(this.CanvasKit.StrokeCap, opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n return this;\n }\n\n reset() {\n this.ref.reset();\n return this;\n }\n\n rewind() {\n this.ref.rewind();\n return this;\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n return this;\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n return this;\n }\n\n addRRect(rrect: InputRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(\n JsiSkPath.fromValue(path),\n getEnum(this.CanvasKit.PathOp, op)\n );\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(start: number, stop: number, isComplement: boolean) {\n const startT = pinT(start);\n const stopT = pinT(stop);\n if (startT === 0 && stopT === 1) {\n return this;\n }\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(Array.isArray(m3) ? m3 : JsiSkMatrix.fromValue(m3));\n return this;\n }\n\n interpolate(end: SkPath, t: number, output?: SkPath) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n if (output) {\n (output as JsiSkPath).ref = path;\n return output;\n } else {\n return new JsiSkPath(this.CanvasKit, path);\n }\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,UAAzB;AAaA,SAASC,OAAT,EAAkBC,UAAlB,EAA8BC,OAA9B,QAA6C,QAA7C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UA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AnB;;MACA,IAAID,OAAO,CAACC,MAAR,KAAmB,CAAvB,EAA0B;QACxBD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACA,MAAMI,MAAM,GAAGrJ,YAAY,CAACoJ,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF,CAND,MAMO;QACL,MAAME,MAAM,GAAGrJ,YAAY,CAACoJ,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,GAAiBA,MAArB,EAA6B;UAC3BD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACD;;QACD,IAAIG,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF;;MACD,OAAOH,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAOpG,MAAP;EACD;;AA3WuE"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import type { CanvasKit, RRect } from "canvaskit-wasm";
|
2
|
-
import type { SkRect, SkRRect } from "../types";
|
2
|
+
import type { InputRRect, SkRect, SkRRect } from "../types";
|
3
3
|
import { BaseHostObject } from "./Host";
|
4
4
|
import { JsiSkRect } from "./JsiSkRect";
|
5
5
|
export declare class JsiSkRRect extends BaseHostObject<RRect, "RRect"> implements SkRRect {
|
6
6
|
dispose: () => void;
|
7
|
-
static fromValue(CanvasKit: CanvasKit, rect:
|
7
|
+
static fromValue(CanvasKit: CanvasKit, rect: InputRRect): Float32Array;
|
8
8
|
constructor(CanvasKit: CanvasKit, rect: SkRect, rx: number, ry: number);
|
9
9
|
get rx(): number;
|
10
10
|
get ry(): number;
|
@@ -8,6 +8,10 @@ export class JsiSkRRect extends BaseHostObject {
|
|
8
8
|
return rect.ref;
|
9
9
|
}
|
10
10
|
|
11
|
+
if ("topLeft" in rect && "topRight" in rect && "bottomRight" in rect && "bottomLeft" in rect) {
|
12
|
+
return Float32Array.of(rect.rect.x, rect.rect.y, rect.rect.x + rect.rect.width, rect.rect.y + rect.rect.height, rect.topLeft.x, rect.topLeft.y, rect.topRight.x, rect.topRight.y, rect.bottomRight.x, rect.bottomRight.y, rect.bottomLeft.x, rect.bottomLeft.y);
|
13
|
+
}
|
14
|
+
|
11
15
|
return CanvasKit.RRectXY(JsiSkRect.fromValue(CanvasKit, rect.rect), rect.rx, rect.ry);
|
12
16
|
}
|
13
17
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseHostObject","JsiSkRect","JsiSkRRect","fromValue","CanvasKit","rect","ref","
|
1
|
+
{"version":3,"names":["BaseHostObject","JsiSkRect","JsiSkRRect","fromValue","CanvasKit","rect","ref","Float32Array","of","x","y","width","height","topLeft","topRight","bottomRight","bottomLeft","RRectXY","rx","ry","constructor","Infinity","scale","Math","min"],"sources":["JsiSkRRect.ts"],"sourcesContent":["import type { CanvasKit, RRect } from \"canvaskit-wasm\";\n\nimport type { InputRRect, SkRect, SkRRect } from \"../types\";\n\nimport { BaseHostObject } from \"./Host\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkRRect\n extends BaseHostObject<RRect, \"RRect\">\n implements SkRRect\n{\n dispose = () => {\n // Float32Array\n };\n\n static fromValue(CanvasKit: CanvasKit, rect: InputRRect) {\n if (rect instanceof JsiSkRect) {\n return rect.ref;\n }\n if (\n \"topLeft\" in rect &&\n \"topRight\" in rect &&\n \"bottomRight\" in rect &&\n \"bottomLeft\" in rect\n ) {\n return Float32Array.of(\n rect.rect.x,\n rect.rect.y,\n rect.rect.x + rect.rect.width,\n rect.rect.y + rect.rect.height,\n rect.topLeft.x,\n rect.topLeft.y,\n rect.topRight.x,\n rect.topRight.y,\n rect.bottomRight.x,\n rect.bottomRight.y,\n rect.bottomLeft.x,\n rect.bottomLeft.y\n );\n }\n return CanvasKit.RRectXY(\n JsiSkRect.fromValue(CanvasKit, rect.rect),\n rect.rx,\n rect.ry\n );\n }\n\n constructor(CanvasKit: CanvasKit, rect: SkRect, rx: number, ry: number) {\n // based on https://github.com/google/skia/blob/main/src/core/SkRRect.cpp#L51\n if (rx === Infinity || ry === Infinity) {\n rx = ry = 0;\n }\n if (rect.width < rx + rx || rect.height < ry + ry) {\n // At most one of these two divides will be by zero, and neither numerator is zero.\n const scale = Math.min(rect.width / (rx + rx), rect.height / (ry + ry));\n rx *= scale;\n ry *= scale;\n }\n const ref = CanvasKit.RRectXY(JsiSkRect.fromValue(CanvasKit, rect), rx, ry);\n super(CanvasKit, ref, \"RRect\");\n }\n\n get rx() {\n return this.ref[4];\n }\n\n get ry() {\n return this.ref[5];\n }\n\n get rect() {\n return new JsiSkRect(\n this.CanvasKit,\n Float32Array.of(this.ref[0], this.ref[1], this.ref[2], this.ref[3])\n );\n }\n}\n"],"mappings":";;AAIA,SAASA,cAAT,QAA+B,QAA/B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,UAAN,SACGF,cADH,CAGP;EAKkB,OAATG,SAAS,CAACC,SAAD,EAAuBC,IAAvB,EAAyC;IACvD,IAAIA,IAAI,YAAYJ,SAApB,EAA+B;MAC7B,OAAOI,IAAI,CAACC,GAAZ;IACD;;IACD,IACE,aAAaD,IAAb,IACA,cAAcA,IADd,IAEA,iBAAiBA,IAFjB,IAGA,gBAAgBA,IAJlB,EAKE;MACA,OAAOE,YAAY,CAACC,EAAb,CACLH,IAAI,CAACA,IAAL,CAAUI,CADL,EAELJ,IAAI,CAACA,IAAL,CAAUK,CAFL,EAGLL,IAAI,CAACA,IAAL,CAAUI,CAAV,GAAcJ,IAAI,CAACA,IAAL,CAAUM,KAHnB,EAILN,IAAI,CAACA,IAAL,CAAUK,CAAV,GAAcL,IAAI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AiBE,GAAjB,EAAsB,OAAtB;;IAZsE,iCApC9D,MAAM,CACd;IACD,CAkCuE;EAavE;;EAEK,IAAFY,EAAE,GAAG;IACP,OAAO,KAAKZ,GAAL,CAAS,CAAT,CAAP;EACD;;EAEK,IAAFa,EAAE,GAAG;IACP,OAAO,KAAKb,GAAL,CAAS,CAAT,CAAP;EACD;;EAEO,IAAJD,IAAI,GAAG;IACT,OAAO,IAAIJ,SAAJ,CACL,KAAKG,SADA,EAELG,YAAY,CAACC,EAAb,CAAgB,KAAKF,GAAL,CAAS,CAAT,CAAhB,EAA6B,KAAKA,GAAL,CAAS,CAAT,CAA7B,EAA0C,KAAKA,GAAL,CAAS,CAAT,CAA1C,EAAuD,KAAKA,GAAL,CAAS,CAAT,CAAvD,CAFK,CAAP;EAID;;AAjEH"}
|
@@ -1,12 +1,16 @@
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
2
2
|
// @ts-ignore
|
3
3
|
import CanvasKitInit from "canvaskit-wasm/bin/full/canvaskit";
|
4
|
+
let ckSharedPromise;
|
4
5
|
export const LoadSkiaWeb = async opts => {
|
6
|
+
var _ckSharedPromise;
|
7
|
+
|
5
8
|
if (global.CanvasKit !== undefined) {
|
6
9
|
return;
|
7
10
|
}
|
8
11
|
|
9
|
-
|
12
|
+
ckSharedPromise = (_ckSharedPromise = ckSharedPromise) !== null && _ckSharedPromise !== void 0 ? _ckSharedPromise : CanvasKitInit(opts);
|
13
|
+
const CanvasKit = await ckSharedPromise; // The CanvasKit API is stored on the global object and used
|
10
14
|
// to create the JsiSKApi in the Skia.web.ts file.
|
11
15
|
|
12
16
|
global.CanvasKit = CanvasKit;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["CanvasKitInit","LoadSkiaWeb","opts","global","CanvasKit","undefined","LoadSkia"],"sources":["LoadSkiaWeb.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport CanvasKitInit from \"canvaskit-wasm/bin/full/canvaskit\";\nimport type {\n CanvasKit as CanvasKitType,\n CanvasKitInitOptions,\n} from \"canvaskit-wasm\";\n\ndeclare global {\n var CanvasKit: CanvasKitType;\n}\n\nexport const LoadSkiaWeb = async (opts?: CanvasKitInitOptions) => {\n if (global.CanvasKit !== undefined) {\n return;\n }\n
|
1
|
+
{"version":3,"names":["CanvasKitInit","ckSharedPromise","LoadSkiaWeb","opts","global","CanvasKit","undefined","LoadSkia"],"sources":["LoadSkiaWeb.tsx"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport CanvasKitInit from \"canvaskit-wasm/bin/full/canvaskit\";\nimport type {\n CanvasKit as CanvasKitType,\n CanvasKitInitOptions,\n} from \"canvaskit-wasm\";\n\ndeclare global {\n var CanvasKit: CanvasKitType;\n}\n\nlet ckSharedPromise: Promise<CanvasKitType>;\n\nexport const LoadSkiaWeb = async (opts?: CanvasKitInitOptions) => {\n if (global.CanvasKit !== undefined) {\n return;\n }\n ckSharedPromise = ckSharedPromise ?? CanvasKitInit(opts);\n const CanvasKit = await ckSharedPromise;\n // The CanvasKit API is stored on the global object and used\n // to create the JsiSKApi in the Skia.web.ts file.\n global.CanvasKit = CanvasKit;\n};\n\n// We keep this function for backward compatibility\nexport const LoadSkia = LoadSkiaWeb;\n"],"mappings":"AAAA;AACA;AACA,OAAOA,aAAP,MAA0B,mCAA1B;AAUA,IAAIC,eAAJ;AAEA,OAAO,MAAMC,WAAW,GAAG,MAAOC,IAAP,IAAuC;EAAA;;EAChE,IAAIC,MAAM,CAACC,SAAP,KAAqBC,SAAzB,EAAoC;IAClC;EACD;;EACDL,eAAe,uBAAGA,eAAH,+DAAsBD,aAAa,CAACG,IAAD,CAAlD;EACA,MAAME,SAAS,GAAG,MAAMJ,eAAxB,CALgE,CAMhE;EACA;;EACAG,MAAM,CAACC,SAAP,GAAmBA,SAAnB;AACD,CATM,C,CAWP;;AACA,OAAO,MAAME,QAAQ,GAAGL,WAAjB"}
|
@@ -2,6 +2,7 @@ import type { PathProps, SkDOM, GroupProps, ImageProps, BlurImageFilterProps, Ma
|
|
2
2
|
import type { BlendImageFilterProps, BlendProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, MorphologyImageFilterProps, RuntimeShaderImageFilterProps } from "../types/ImageFilters";
|
3
3
|
import type { CornerPathEffectProps, DashPathEffectProps, DiscretePathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps } from "../types/PathEffects";
|
4
4
|
import type { ParagraphProps } from "../types/Paragraph";
|
5
|
+
import { RRectNode } from "./drawings";
|
5
6
|
import type { NodeContext } from "./Node";
|
6
7
|
export declare class JsiSkDOM implements SkDOM {
|
7
8
|
private ctx;
|
@@ -18,7 +19,7 @@ export declare class JsiSkDOM implements SkDOM {
|
|
18
19
|
Patch(props: PatchProps): import("../types").RenderNode<PatchProps>;
|
19
20
|
Points(props: PointsProps): import("../types").RenderNode<PointsProps>;
|
20
21
|
Rect(props: RectProps): import("./DrawingNode").JsiDrawingNode<RectProps, import("../..").SkRect>;
|
21
|
-
RRect(props: RoundedRectProps): import("./DrawingNode").JsiDrawingNode<RoundedRectProps, import("../..").SkRRect
|
22
|
+
RRect(props: RoundedRectProps): import("./DrawingNode").JsiDrawingNode<RoundedRectProps, import("../..").SkRRect> | RRectNode;
|
22
23
|
Vertices(props: VerticesProps): import("../types").RenderNode<VerticesProps>;
|
23
24
|
Text(props: TextProps): import("../types").RenderNode<TextProps>;
|
24
25
|
TextPath(props: TextPathProps): import("../types").RenderNode<TextPathProps>;
|
@@ -2,4 +2,4 @@ import type { Skia, SkRect, Vector } from "../../../skia/types";
|
|
2
2
|
import type { RectDef, RRectDef } from "../../types";
|
3
3
|
export declare const isEdge: (pos: Vector, b: SkRect) => boolean;
|
4
4
|
export declare const processRect: (Skia: Skia, def: RectDef) => SkRect;
|
5
|
-
export declare const processRRect: (Skia: Skia, def: RRectDef) => import("../../../skia/types").
|
5
|
+
export declare const processRRect: (Skia: Skia, def: RRectDef) => import("../../../skia/types").InputRRect;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import type { SkRRect } from "../../../skia/types";
|
1
|
+
import type { InputRRect, SkRRect } from "../../../skia/types";
|
2
2
|
import type { DrawingContext, RoundedRectProps } from "../../types";
|
3
3
|
import { JsiDrawingNode } from "../DrawingNode";
|
4
4
|
import type { NodeContext } from "../Node";
|
5
|
-
export declare class RRectNode extends JsiDrawingNode<RoundedRectProps,
|
5
|
+
export declare class RRectNode extends JsiDrawingNode<RoundedRectProps, InputRRect> {
|
6
6
|
rect?: SkRRect;
|
7
7
|
constructor(ctx: NodeContext, props: RoundedRectProps);
|
8
|
-
protected deriveProps():
|
8
|
+
protected deriveProps(): InputRRect;
|
9
9
|
draw({ canvas, paint }: DrawingContext): void;
|
10
10
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
|
-
import type { BlendMode, Color, InputMatrix, PaintStyle, SkPaint, SkPath, SkRect, SkRRect, StrokeCap, StrokeJoin, Transforms3d, Vector } from "../../skia/types";
|
2
|
+
import type { BlendMode, Color, InputMatrix, InputRRect, PaintStyle, SkPaint, SkPath, SkRect, SkRRect, StrokeCap, StrokeJoin, Transforms3d, Vector } from "../../skia/types";
|
3
3
|
export type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;
|
4
4
|
export type PathDef = string | SkPath;
|
5
5
|
export type ClipDef = SkRRect | SkRect | PathDef;
|
@@ -21,7 +21,7 @@ export type RectDef = RectCtor | {
|
|
21
21
|
rect: SkRect;
|
22
22
|
};
|
23
23
|
export type RRectDef = RRectCtor | {
|
24
|
-
rect:
|
24
|
+
rect: InputRRect;
|
25
25
|
};
|
26
26
|
export interface PointCircleDef {
|
27
27
|
c?: Vector;
|
@@ -1,3 +1,5 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
|
+
import type { SkSurface } from "../skia";
|
2
3
|
export * from "../renderer/components";
|
3
|
-
export declare const
|
4
|
+
export declare const makeOffscreenSurface: (width: number, height: number) => any;
|
5
|
+
export declare const drawOffscreen: (surface: SkSurface, element: ReactNode) => import("../skia").SkImage;
|
@@ -5,7 +5,7 @@ import type { SkPath } from "./Path";
|
|
5
5
|
import type { SkImage, MipmapMode, FilterMode, ImageInfo } from "./Image";
|
6
6
|
import type { SkSVG } from "./SVG";
|
7
7
|
import type { SkColor } from "./Color";
|
8
|
-
import type {
|
8
|
+
import type { InputRRect } from "./RRect";
|
9
9
|
import type { BlendMode } from "./Paint/BlendMode";
|
10
10
|
import type { SkPoint, PointMode } from "./Point";
|
11
11
|
import type { InputMatrix } from "./Matrix";
|
@@ -202,7 +202,7 @@ export interface SkCanvas {
|
|
202
202
|
* @param rrect
|
203
203
|
* @param paint
|
204
204
|
*/
|
205
|
-
drawRRect(rrect:
|
205
|
+
drawRRect(rrect: InputRRect, paint: SkPaint): void;
|
206
206
|
/**
|
207
207
|
* Draws RRect outer and inner using clip, Matrix, and Paint paint.
|
208
208
|
* outer must contain inner or the drawing is undefined.
|
@@ -210,7 +210,7 @@ export interface SkCanvas {
|
|
210
210
|
* @param inner
|
211
211
|
* @param paint
|
212
212
|
*/
|
213
|
-
drawDRRect(outer:
|
213
|
+
drawDRRect(outer: InputRRect, inner: InputRRect, paint: SkPaint): void;
|
214
214
|
/**
|
215
215
|
* Draws an oval bounded by the given rectangle using the current clip, current matrix,
|
216
216
|
* and the provided paint.
|
@@ -367,7 +367,7 @@ export interface SkCanvas {
|
|
367
367
|
* @param op
|
368
368
|
* @param doAntiAlias
|
369
369
|
*/
|
370
|
-
clipRRect(rrect:
|
370
|
+
clipRRect(rrect: InputRRect, op: ClipOp, doAntiAlias: boolean): void;
|
371
371
|
/**
|
372
372
|
* Replaces current matrix with m premultiplied with the existing matrix.
|
373
373
|
* @param m
|
@@ -4,6 +4,7 @@ type Point = {
|
|
4
4
|
};
|
5
5
|
type Vec2 = readonly [number, number];
|
6
6
|
type Vec3 = readonly [number, number, number];
|
7
|
+
type Vec4 = readonly [number, number, number, number];
|
7
8
|
export type Matrix3 = readonly [
|
8
9
|
number,
|
9
10
|
number,
|
@@ -51,6 +52,10 @@ export declare const translate: (x: number, y: number, z?: number) => Matrix4;
|
|
51
52
|
* @worklet
|
52
53
|
*/
|
53
54
|
export declare const perspective: (p: number) => Matrix4;
|
55
|
+
/**
|
56
|
+
* @worklet
|
57
|
+
*/
|
58
|
+
export declare const matrixVecMul4: (m: Matrix4, v: Vec4) => Vec4;
|
54
59
|
/**
|
55
60
|
* @worklet
|
56
61
|
*/
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import type { SkCanvas } from "../Canvas";
|
2
2
|
import type { SkJSIInstance } from "../JsiInstance";
|
3
3
|
import type { SkRect } from "../Rect";
|
4
|
-
import type {
|
4
|
+
import type { TextDirection } from "./ParagraphStyle";
|
5
5
|
export interface SkRectWithDirection {
|
6
6
|
rect: SkRect;
|
7
|
-
direction:
|
7
|
+
direction: TextDirection;
|
8
8
|
}
|
9
9
|
export interface SkParagraph extends SkJSIInstance<"Paragraph"> {
|
10
10
|
/**
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { SkTextFontStyle, SkTextStyle } from "./TextStyle";
|
2
|
-
export declare enum
|
2
|
+
export declare enum TextDirection {
|
3
3
|
RTL = 0,
|
4
4
|
LTR = 1
|
5
5
|
}
|
6
|
-
export declare enum
|
6
|
+
export declare enum TextAlign {
|
7
7
|
Left = 0,
|
8
8
|
Right = 1,
|
9
9
|
Center = 2,
|
@@ -21,7 +21,7 @@ export interface SkStrutStyle {
|
|
21
21
|
leading?: number;
|
22
22
|
forceStrutHeight?: boolean;
|
23
23
|
}
|
24
|
-
export declare enum
|
24
|
+
export declare enum TextHeightBehavior {
|
25
25
|
All = 0,
|
26
26
|
DisableFirstAscent = 1,
|
27
27
|
DisableLastDescent = 2,
|
@@ -34,8 +34,8 @@ export interface SkParagraphStyle {
|
|
34
34
|
maxLines?: number;
|
35
35
|
replaceTabCharacters?: boolean;
|
36
36
|
strutStyle?: SkStrutStyle;
|
37
|
-
textAlign?:
|
38
|
-
textDirection?:
|
39
|
-
textHeightBehavior?:
|
37
|
+
textAlign?: TextAlign;
|
38
|
+
textDirection?: TextDirection;
|
39
|
+
textHeightBehavior?: TextHeightBehavior;
|
40
40
|
textStyle?: SkTextStyle;
|
41
41
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { SkRect } from "../Rect";
|
2
2
|
import type { SkPoint } from "../Point";
|
3
|
-
import type {
|
3
|
+
import type { InputRRect } from "../RRect";
|
4
4
|
import type { StrokeJoin, StrokeCap } from "../Paint";
|
5
5
|
import type { InputMatrix, SkMatrix } from "../Matrix";
|
6
6
|
import type { SkJSIInstance } from "../JsiInstance";
|
@@ -347,7 +347,7 @@ export interface SkPath extends SkJSIInstance<"Path"> {
|
|
347
347
|
* @param rrect
|
348
348
|
* @param isCCW
|
349
349
|
*/
|
350
|
-
addRRect(rrect:
|
350
|
+
addRRect(rrect: InputRRect, isCCW?: boolean): SkPath;
|
351
351
|
/** Appends src to SkPath, transformed by matrix. Transformed curves may have
|
352
352
|
different verbs, SkPoint, and conic weights.
|
353
353
|
|
@@ -1,7 +1,16 @@
|
|
1
|
+
import type { SkPoint } from "./Point";
|
1
2
|
import type { SkRect } from "./Rect";
|
2
3
|
export interface SkRRect {
|
3
4
|
readonly rect: SkRect;
|
4
5
|
readonly rx: number;
|
5
6
|
readonly ry: number;
|
6
7
|
}
|
8
|
+
export interface NonUniformRRect {
|
9
|
+
readonly rect: SkRect;
|
10
|
+
readonly topLeft: SkPoint;
|
11
|
+
readonly topRight: SkPoint;
|
12
|
+
readonly bottomRight: SkPoint;
|
13
|
+
readonly bottomLeft: SkPoint;
|
14
|
+
}
|
15
|
+
export type InputRRect = SkRRect | NonUniformRRect;
|
7
16
|
export declare const isRRect: (def: SkRect | SkRRect) => def is SkRRect;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { Canvas, CanvasKit } from "canvaskit-wasm";
|
2
|
-
import type { BlendMode, ClipOp, FilterMode, MipmapMode, PointMode, SaveLayerFlag, ImageInfo, SkCanvas, SkColor, SkFont, SkImage, SkImageFilter, SkMatrix, SkPaint, SkPath, SkPicture, SkPoint, SkRect,
|
2
|
+
import type { BlendMode, ClipOp, FilterMode, MipmapMode, PointMode, SaveLayerFlag, ImageInfo, SkCanvas, SkColor, SkFont, SkImage, SkImageFilter, SkMatrix, SkPaint, SkPath, SkPicture, SkPoint, SkRect, InputRRect, SkSVG, SkTextBlob, SkVertices } from "../types";
|
3
3
|
import { HostObject } from "./Host";
|
4
4
|
export declare class JsiSkCanvas extends HostObject<Canvas, "Canvas"> implements SkCanvas {
|
5
5
|
constructor(CanvasKit: CanvasKit, ref: Canvas);
|
@@ -20,8 +20,8 @@ export declare class JsiSkCanvas extends HostObject<Canvas, "Canvas"> implements
|
|
20
20
|
restoreToCount(saveCount: number): void;
|
21
21
|
drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint): void;
|
22
22
|
drawArc(oval: SkRect, startAngle: number, sweepAngle: number, useCenter: boolean, paint: SkPaint): void;
|
23
|
-
drawRRect(rrect:
|
24
|
-
drawDRRect(outer:
|
23
|
+
drawRRect(rrect: InputRRect, paint: SkPaint): void;
|
24
|
+
drawDRRect(outer: InputRRect, inner: InputRRect, paint: SkPaint): void;
|
25
25
|
drawOval(oval: SkRect, paint: SkPaint): void;
|
26
26
|
drawPath(path: SkPath, paint: SkPaint): void;
|
27
27
|
drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont): void;
|
@@ -39,7 +39,7 @@ export declare class JsiSkCanvas extends HostObject<Canvas, "Canvas"> implements
|
|
39
39
|
clear(color: SkColor): void;
|
40
40
|
clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean): void;
|
41
41
|
clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean): void;
|
42
|
-
clipRRect(rrect:
|
42
|
+
clipRRect(rrect: InputRRect, op: ClipOp, doAntiAlias: boolean): void;
|
43
43
|
concat(m: SkMatrix | number[]): void;
|
44
44
|
drawPicture(skp: SkPicture): void;
|
45
45
|
readPixels(srcX: number, srcY: number, imageInfo: ImageInfo): Float32Array | Uint8Array | null;
|