@shopify/react-native-skia 0.1.163 → 0.1.165
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkPaint.h +6 -0
- package/cpp/api/JsiSkRuntimeEffect.h +7 -2
- package/cpp/jsi/JsiHostObject.h +25 -25
- package/cpp/rnskia/RNSkDomView.cpp +1 -1
- package/cpp/rnskia/RNSkPlatformContext.h +2 -6
- package/cpp/rnskia/dom/base/DrawingContext.cpp +23 -41
- package/cpp/rnskia/dom/base/DrawingContext.h +6 -19
- package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +12 -2
- package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +4 -4
- package/cpp/rnskia/dom/base/JsiDomNode.h +68 -10
- package/cpp/rnskia/dom/base/JsiDomRenderNode.h +26 -61
- package/cpp/rnskia/dom/base/NodeProp.h +2 -1
- package/cpp/rnskia/dom/base/NodePropsContainer.h +10 -0
- package/cpp/rnskia/dom/nodes/JsiBlendNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +3 -6
- package/cpp/rnskia/dom/nodes/JsiBoxNode.h +2 -4
- package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiCircleNode.h +2 -5
- package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +4 -8
- package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +2 -5
- package/cpp/rnskia/dom/nodes/JsiDiffRectNode.h +2 -7
- package/cpp/rnskia/dom/nodes/JsiGlyphsNode.h +4 -8
- package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +20 -38
- package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -1
- package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +2 -4
- package/cpp/rnskia/dom/nodes/JsiLineNode.h +2 -7
- package/cpp/rnskia/dom/nodes/JsiOvalNode.h +1 -3
- package/cpp/rnskia/dom/nodes/JsiPaintNode.h +2 -3
- package/cpp/rnskia/dom/nodes/JsiPatchNode.h +4 -8
- package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +14 -28
- package/cpp/rnskia/dom/nodes/JsiPathNode.h +6 -16
- package/cpp/rnskia/dom/nodes/JsiPictureNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiPointsNode.h +2 -5
- package/cpp/rnskia/dom/nodes/JsiRRectNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiRectNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +37 -69
- package/cpp/rnskia/dom/nodes/JsiTextBlobNode.h +3 -6
- package/cpp/rnskia/dom/nodes/JsiTextNode.h +4 -8
- package/cpp/rnskia/dom/nodes/JsiTextPathNode.h +1 -2
- package/cpp/rnskia/dom/nodes/JsiVerticesNode.h +2 -4
- package/cpp/rnskia/dom/props/CircleProp.h +2 -0
- package/cpp/rnskia/dom/props/ColorProp.h +9 -4
- package/cpp/rnskia/dom/props/ImageProps.h +3 -2
- package/cpp/rnskia/dom/props/PaintProps.h +15 -7
- package/cpp/rnskia/dom/props/RectProp.h +11 -4
- package/cpp/rnskia/dom/props/TransformProp.h +0 -2
- package/cpp/rnskia/dom/props/UniformsProp.h +86 -123
- package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -6
- package/cpp/utils/RNSkLog.h +1 -1
- package/lib/commonjs/dom/nodes/RenderNode.js +12 -16
- package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js +6 -1
- package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.js +3 -3
- package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/index.js +0 -13
- package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Box.js +6 -6
- package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js +2 -2
- package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js +3 -7
- package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +1 -1
- package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js +1 -3
- package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js +1 -1
- package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/commonjs/dom/nodes/paint/Shaders.js +1 -3
- package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js +2 -6
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/renderer/components/image/Image.js +0 -5
- package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
- package/lib/commonjs/renderer/components/image/ImageShader.js +20 -10
- package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Blur.js +10 -5
- package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js +10 -5
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Offset.js +12 -6
- package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/commonjs/renderer/components/maskFilters/Blur.js +12 -6
- package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js +10 -5
- package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js +14 -7
- package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Shader.js +10 -5
- package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/commonjs/renderer/components/shaders/Turbulence.js +14 -7
- package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Circle.js +0 -6
- package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.js +1 -4
- package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Oval.js +0 -4
- package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Path.js +12 -6
- package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Points.js +10 -5
- package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js +0 -3
- package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/Vertices.js +10 -5
- package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Glyphs.js +12 -6
- package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/commonjs/renderer/components/text/Text.js +12 -6
- package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextBlob.js +12 -6
- package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/commonjs/renderer/components/text/TextPath.js +10 -5
- package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
- package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/types/Shader/Shader.js +3 -2
- package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js +4 -0
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/commonjs/web/LoadSkiaWeb.js +1 -1
- package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
- package/lib/module/dom/nodes/RenderNode.js +12 -16
- package/lib/module/dom/nodes/RenderNode.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Circle.js +8 -1
- package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.js +7 -3
- package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/index.js +0 -1
- package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Box.js +6 -5
- package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
- package/lib/module/dom/nodes/drawings/ImageNode.js +4 -2
- package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/PatchNode.js +4 -8
- package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/VerticesNode.js +2 -2
- package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
- package/lib/module/dom/nodes/paint/ColorFilters.js +1 -2
- package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/ImageFilters.js +2 -2
- package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
- package/lib/module/dom/nodes/paint/Shaders.js +1 -2
- package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/DrawingContext.js.map +1 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/renderer/DrawingContext.js.map +1 -1
- package/lib/module/renderer/components/Mask.js +2 -6
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/image/Image.js +0 -5
- package/lib/module/renderer/components/image/Image.js.map +1 -1
- package/lib/module/renderer/components/image/ImageShader.js +20 -10
- package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Blur.js +10 -5
- package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js +10 -5
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Offset.js +12 -6
- package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
- package/lib/module/renderer/components/maskFilters/Blur.js +12 -6
- package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
- package/lib/module/renderer/components/pathEffects/Discrete.js +10 -5
- package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
- package/lib/module/renderer/components/shaders/FractalNoise.js +14 -7
- package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
- package/lib/module/renderer/components/shaders/Shader.js +10 -5
- package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
- package/lib/module/renderer/components/shaders/Turbulence.js +14 -7
- package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
- package/lib/module/renderer/components/shapes/Circle.js +0 -6
- package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.js +1 -4
- package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
- package/lib/module/renderer/components/shapes/Oval.js +0 -4
- package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
- package/lib/module/renderer/components/shapes/Path.js +12 -6
- package/lib/module/renderer/components/shapes/Path.js.map +1 -1
- package/lib/module/renderer/components/shapes/Points.js +10 -5
- package/lib/module/renderer/components/shapes/Points.js.map +1 -1
- package/lib/module/renderer/components/shapes/RoundedRect.js +0 -3
- package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
- package/lib/module/renderer/components/shapes/Vertices.js +10 -5
- package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
- package/lib/module/renderer/components/text/Glyphs.js +12 -6
- package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
- package/lib/module/renderer/components/text/Text.js +12 -6
- package/lib/module/renderer/components/text/Text.js.map +1 -1
- package/lib/module/renderer/components/text/TextBlob.js +12 -6
- package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
- package/lib/module/renderer/components/text/TextPath.js +10 -5
- package/lib/module/renderer/components/text/TextPath.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/skia/types/Paint/Paint.js.map +1 -1
- package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
- package/lib/module/skia/types/Shader/Shader.js +3 -2
- package/lib/module/skia/types/Shader/Shader.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +4 -0
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
- package/lib/module/web/LoadSkiaWeb.js +1 -1
- package/lib/module/web/LoadSkiaWeb.js.map +1 -1
- package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -1
- package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +0 -1
- package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +1 -1
- package/lib/typescript/src/dom/types/Common.d.ts +4 -4
- package/lib/typescript/src/dom/types/DrawingContext.d.ts +0 -1
- package/lib/typescript/src/dom/types/Drawings.d.ts +1 -1
- package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -5
- package/lib/typescript/src/renderer/components/Mask.d.ts +3 -9
- package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -8
- package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -12
- package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +2 -7
- package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +2 -7
- package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +2 -8
- package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +2 -8
- package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +2 -9
- package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +2 -9
- package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +1 -9
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +1 -7
- package/lib/typescript/src/renderer/components/shapes/Path.d.ts +2 -8
- package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -7
- package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +1 -6
- package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -7
- package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/Text.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +2 -8
- package/lib/typescript/src/renderer/components/text/TextPath.d.ts +2 -7
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +5 -0
- package/lib/typescript/src/skia/types/Paint/Paint.d.ts +4 -0
- package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +4 -0
- package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +3 -1
- package/package.json +1 -1
- package/src/dom/nodes/RenderNode.ts +11 -21
- package/src/dom/nodes/datatypes/Circle.ts +1 -1
- package/src/dom/nodes/datatypes/Rect.ts +3 -3
- package/src/dom/nodes/datatypes/index.ts +0 -1
- package/src/dom/nodes/drawings/Box.ts +7 -4
- package/src/dom/nodes/drawings/ImageNode.ts +2 -1
- package/src/dom/nodes/drawings/PatchNode.ts +4 -18
- package/src/dom/nodes/drawings/VerticesNode.ts +2 -2
- package/src/dom/nodes/paint/ColorFilters.ts +1 -2
- package/src/dom/nodes/paint/ImageFilters.ts +2 -2
- package/src/dom/nodes/paint/Shaders.ts +1 -2
- package/src/dom/types/Common.ts +4 -4
- package/src/dom/types/DrawingContext.ts +0 -1
- package/src/dom/types/Drawings.ts +1 -1
- package/src/renderer/DrawingContext.ts +5 -5
- package/src/renderer/components/Mask.tsx +8 -8
- package/src/renderer/components/image/Image.tsx +0 -6
- package/src/renderer/components/image/ImageShader.tsx +24 -12
- package/src/renderer/components/imageFilters/Blur.tsx +6 -7
- package/src/renderer/components/imageFilters/Morphology.tsx +6 -7
- package/src/renderer/components/imageFilters/Offset.tsx +7 -8
- package/src/renderer/components/maskFilters/Blur.tsx +7 -8
- package/src/renderer/components/pathEffects/Discrete.tsx +6 -9
- package/src/renderer/components/shaders/FractalNoise.tsx +18 -9
- package/src/renderer/components/shaders/Shader.tsx +6 -7
- package/src/renderer/components/shaders/Turbulence.tsx +15 -9
- package/src/renderer/components/shapes/Circle.tsx +0 -4
- package/src/renderer/components/shapes/FitBox.tsx +2 -6
- package/src/renderer/components/shapes/Oval.tsx +0 -5
- package/src/renderer/components/shapes/Path.tsx +7 -8
- package/src/renderer/components/shapes/Points.tsx +6 -7
- package/src/renderer/components/shapes/RoundedRect.tsx +0 -4
- package/src/renderer/components/shapes/Vertices.tsx +6 -7
- package/src/renderer/components/text/Glyphs.tsx +7 -8
- package/src/renderer/components/text/Text.tsx +7 -8
- package/src/renderer/components/text/TextBlob.tsx +7 -8
- package/src/renderer/components/text/TextPath.tsx +6 -7
- package/src/renderer/processors/Animations/Animations.ts +9 -3
- package/src/skia/types/Paint/Paint.ts +5 -0
- package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +5 -0
- package/src/skia/types/Shader/Shader.ts +5 -3
- package/src/skia/web/JsiSkPaint.ts +4 -0
- package/src/skia/web/JsiSkRuntimeEffect.ts +5 -1
- package/src/skia/web/JsiSkRuntimeEffectFactory.ts +1 -1
- package/src/web/LoadSkiaWeb.tsx +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Color.js +0 -27
- package/lib/commonjs/dom/nodes/datatypes/Color.js.map +0 -1
- package/lib/module/dom/nodes/datatypes/Color.js +0 -11
- package/lib/module/dom/nodes/datatypes/Color.js.map +0 -1
- package/lib/typescript/src/dom/nodes/datatypes/Color.d.ts +0 -7
- package/src/dom/nodes/datatypes/Color.ts +0 -15
@@ -9,13 +9,13 @@ export interface ChildrenProps {
|
|
9
9
|
children?: ReactNode | ReactNode[];
|
10
10
|
}
|
11
11
|
export interface RectCtor {
|
12
|
-
x
|
13
|
-
y
|
12
|
+
x?: number;
|
13
|
+
y?: number;
|
14
14
|
width: number;
|
15
15
|
height: number;
|
16
16
|
}
|
17
17
|
export interface RRectCtor extends RectCtor {
|
18
|
-
r
|
18
|
+
r?: Radius;
|
19
19
|
}
|
20
20
|
export declare type RectDef = RectCtor | {
|
21
21
|
rect: SkRect;
|
@@ -24,7 +24,7 @@ export declare type RRectDef = RRectCtor | {
|
|
24
24
|
rect: SkRRect;
|
25
25
|
};
|
26
26
|
export interface PointCircleDef {
|
27
|
-
c
|
27
|
+
c?: Vector;
|
28
28
|
r: number;
|
29
29
|
}
|
30
30
|
export interface ScalarCircleDef {
|
@@ -1,10 +1,8 @@
|
|
1
1
|
import type { RefObject } from "react";
|
2
2
|
import type { DrawingInfo, SkiaView } from "../views";
|
3
|
-
import type {
|
4
|
-
|
5
|
-
|
6
|
-
paint: SkPaint;
|
7
|
-
opacity: number;
|
3
|
+
import type { Skia, Vector } from "../skia/types";
|
4
|
+
import type { DrawingContext as DOMDrawingContext } from "../dom/types";
|
5
|
+
export interface DrawingContext extends Omit<DrawingInfo, "touches">, DOMDrawingContext {
|
8
6
|
center: Vector;
|
9
7
|
ref: RefObject<SkiaView>;
|
10
8
|
Skia: Skia;
|
@@ -1,15 +1,9 @@
|
|
1
1
|
import type { ReactNode } from "react";
|
2
2
|
interface MaskProps {
|
3
|
-
mode
|
4
|
-
clip
|
3
|
+
mode?: "luminance" | "alpha";
|
4
|
+
clip?: boolean;
|
5
5
|
mask: ReactNode | ReactNode[];
|
6
6
|
children: ReactNode | ReactNode[];
|
7
7
|
}
|
8
|
-
export declare const Mask: {
|
9
|
-
({ children, mask, mode, clip }: MaskProps): JSX.Element;
|
10
|
-
defaultProps: {
|
11
|
-
mode: string;
|
12
|
-
clip: boolean;
|
13
|
-
};
|
14
|
-
};
|
8
|
+
export declare const Mask: ({ children, mask, mode, clip, }: MaskProps) => JSX.Element;
|
15
9
|
export {};
|
@@ -1,11 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { SkiaProps } from "../../processors";
|
3
3
|
import type { ImageProps } from "../../../dom/types";
|
4
|
-
export declare const Image:
|
5
|
-
(props: SkiaProps<ImageProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
fit: string;
|
10
|
-
};
|
11
|
-
};
|
4
|
+
export declare const Image: (props: SkiaProps<ImageProps>) => JSX.Element;
|
@@ -1,14 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { ImageShaderProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const ImageShader: {
|
5
|
-
(props: SkiaProps<ImageShaderProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
readonly tx: "decal";
|
8
|
-
readonly ty: "decal";
|
9
|
-
readonly fm: "nearest";
|
10
|
-
readonly mm: "none";
|
11
|
-
readonly fit: "none";
|
12
|
-
readonly transform: readonly [];
|
13
|
-
};
|
14
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors";
|
4
|
+
export declare const ImageShader: ({ tx, ty, fm, mm, fit, transform, ...props }: SkiaDefaultProps<ImageShaderProps, "tx" | "ty" | "fm" | "mm" | "fit" | "transform">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
3
3
|
import type { BlurImageFilterProps } from "../../../dom/types";
|
4
|
-
export declare const Blur: {
|
5
|
-
(props: SkiaProps<BlurImageFilterProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
mode: string;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const Blur: ({ mode, ...props }: SkiaDefaultProps<BlurImageFilterProps, "mode">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { MorphologyImageFilterProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const Morphology: {
|
5
|
-
(props: SkiaProps<MorphologyImageFilterProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
operator: string;
|
8
|
-
};
|
9
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors";
|
4
|
+
export declare const Morphology: ({ operator, ...props }: SkiaDefaultProps<MorphologyImageFilterProps, "operator">) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
3
3
|
import type { OffsetImageFilterProps } from "../../../dom/types";
|
4
|
-
export declare const Offset: {
|
5
|
-
(props: SkiaProps<OffsetImageFilterProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
};
|
10
|
-
};
|
4
|
+
export declare const Offset: ({ x, y, ...props }: SkiaDefaultProps<OffsetImageFilterProps, "x" | "y">) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { BlurMaskFilterProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const BlurMask: {
|
5
|
-
(props: SkiaProps<BlurMaskFilterProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
style: string;
|
8
|
-
respectCTM: boolean;
|
9
|
-
};
|
10
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
|
+
export declare const BlurMask: ({ style, respectCTM, ...props }: SkiaDefaultProps<BlurMaskFilterProps, "style" | "respectCTM">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
3
3
|
import type { DiscretePathEffectProps } from "../../../dom/types";
|
4
|
-
export declare const DiscretePathEffect: {
|
5
|
-
(props: SkiaProps<DiscretePathEffectProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
seed: number;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const DiscretePathEffect: ({ seed, ...props }: SkiaDefaultProps<DiscretePathEffectProps, "seed">) => JSX.Element;
|
@@ -1,11 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { FractalNoiseProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const FractalNoise: {
|
5
|
-
(props: SkiaProps<FractalNoiseProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
seed: number;
|
8
|
-
tileWidth: number;
|
9
|
-
tileHeight: number;
|
10
|
-
};
|
11
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
|
+
export declare const FractalNoise: ({ seed, tileWidth, tileHeight, ...props }: SkiaDefaultProps<FractalNoiseProps, "seed" | "tileHeight" | "tileWidth">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { ShaderProps } from "../../../dom/types";
|
4
|
-
export declare const Shader: {
|
5
|
-
(props: SkiaProps<ShaderProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
uniforms: never[];
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const Shader: ({ uniforms, ...props }: SkiaDefaultProps<ShaderProps, "uniforms">) => JSX.Element;
|
@@ -1,11 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { TurbulenceProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const Turbulence: {
|
5
|
-
(props: SkiaProps<TurbulenceProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
seed: number;
|
8
|
-
tileWidth: number;
|
9
|
-
tileHeight: number;
|
10
|
-
};
|
11
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
|
+
export declare const Turbulence: ({ seed, tileWidth, tileHeight, ...props }: SkiaDefaultProps<TurbulenceProps, "seed" | "tileWidth" | "tileHeight">) => JSX.Element;
|
@@ -1,12 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { SkiaProps } from "../../processors";
|
3
3
|
import type { CircleProps } from "../../../dom/types";
|
4
|
-
export declare const Circle:
|
5
|
-
(props: SkiaProps<CircleProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
c: {
|
8
|
-
x: number;
|
9
|
-
y: number;
|
10
|
-
};
|
11
|
-
};
|
12
|
-
};
|
4
|
+
export declare const Circle: (props: SkiaProps<CircleProps>) => JSX.Element;
|
@@ -2,7 +2,7 @@ import type { ReactNode } from "react";
|
|
2
2
|
import type { Fit } from "../../../dom/nodes";
|
3
3
|
import type { SkRect } from "../../../skia/types";
|
4
4
|
interface FitProps {
|
5
|
-
fit
|
5
|
+
fit?: Fit;
|
6
6
|
src: SkRect;
|
7
7
|
dst: SkRect;
|
8
8
|
children: ReactNode | ReactNode[];
|
@@ -16,10 +16,5 @@ export declare const fitbox: (fit: Fit, src: SkRect, dst: SkRect) => readonly [{
|
|
16
16
|
}, {
|
17
17
|
readonly scaleY: number;
|
18
18
|
}];
|
19
|
-
export declare const FitBox: {
|
20
|
-
({ fit, src, dst, children }: FitProps): JSX.Element;
|
21
|
-
defaultProps: {
|
22
|
-
fit: string;
|
23
|
-
};
|
24
|
-
};
|
19
|
+
export declare const FitBox: ({ fit, src, dst, children }: FitProps) => JSX.Element;
|
25
20
|
export {};
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { OvalProps } from "../../../dom/types";
|
3
3
|
import type { SkiaProps } from "../../processors";
|
4
|
-
export declare const Oval:
|
5
|
-
(props: SkiaProps<OvalProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
};
|
10
|
-
};
|
4
|
+
export declare const Oval: (props: SkiaProps<OvalProps>) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { PathProps } from "../../../dom/types";
|
4
|
-
export declare const Path: {
|
5
|
-
(props: SkiaProps<PathProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
start: number;
|
8
|
-
end: number;
|
9
|
-
};
|
10
|
-
};
|
4
|
+
export declare const Path: ({ start, end, ...props }: SkiaDefaultProps<PathProps, "start" | "end">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
3
3
|
import type { PointsProps } from "../../../dom/types";
|
4
|
-
export declare const Points: {
|
5
|
-
(props: SkiaProps<PointsProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
mode: string;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const Points: ({ mode, ...props }: SkiaDefaultProps<PointsProps, "mode">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { RoundedRectProps } from "../../../dom/types";
|
3
3
|
import type { SkiaProps } from "../../processors";
|
4
|
-
export declare const RoundedRect:
|
5
|
-
(props: SkiaProps<RoundedRectProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
r: number;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const RoundedRect: (props: SkiaProps<RoundedRectProps>) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { VerticesProps } from "../../../dom/types";
|
4
|
-
export declare const Vertices: {
|
5
|
-
(props: SkiaProps<VerticesProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
mode: string;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const Vertices: ({ mode, ...props }: SkiaDefaultProps<VerticesProps, "mode">) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import type { GlyphsProps } from "../../../dom/types";
|
3
|
-
import type {
|
4
|
-
export declare const Glyphs: {
|
5
|
-
(props: SkiaProps<GlyphsProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
};
|
10
|
-
};
|
3
|
+
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
|
4
|
+
export declare const Glyphs: ({ x, y, ...props }: SkiaDefaultProps<GlyphsProps, "x" | "y">) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { TextProps } from "../../../dom/types";
|
4
|
-
export declare const Text: {
|
5
|
-
(props: SkiaProps<TextProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
};
|
10
|
-
};
|
4
|
+
export declare const Text: ({ x, y, ...props }: SkiaDefaultProps<TextProps, "x" | "y">) => JSX.Element;
|
@@ -1,10 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { TextBlobProps } from "../../../dom/types";
|
4
|
-
export declare const TextBlob: {
|
5
|
-
(props: SkiaProps<TextBlobProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
x: number;
|
8
|
-
y: number;
|
9
|
-
};
|
10
|
-
};
|
4
|
+
export declare const TextBlob: ({ x, y, ...props }: SkiaDefaultProps<TextBlobProps, "x" | "y">) => JSX.Element;
|
@@ -1,9 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { SkiaDefaultProps } from "../../processors";
|
3
3
|
import type { TextPathProps } from "../../../dom/types";
|
4
|
-
export declare const TextPath: {
|
5
|
-
(props: SkiaProps<TextPathProps>): JSX.Element;
|
6
|
-
defaultProps: {
|
7
|
-
initialOffset: number;
|
8
|
-
};
|
9
|
-
};
|
4
|
+
export declare const TextPath: ({ initialOffset, ...props }: SkiaDefaultProps<TextPathProps, "initialOffset">) => JSX.Element;
|
@@ -10,3 +10,8 @@ export declare type AnimatedProps<T, O extends keyof T | never = never> = {
|
|
10
10
|
[K in keyof T]: K extends "children" ? T[K] : K extends O ? T[K] : AnimatedProp<T[K]>;
|
11
11
|
};
|
12
12
|
export declare type SkiaProps<P = object, O extends keyof P | never = never> = AnimatedProps<P, O>;
|
13
|
+
declare type WithOptional<T extends object, N extends keyof T> = Omit<T, N> & {
|
14
|
+
[K in N]?: T[K];
|
15
|
+
};
|
16
|
+
export declare type SkiaDefaultProps<T extends object, N extends keyof T> = WithOptional<SkiaProps<T>, N>;
|
17
|
+
export {};
|
@@ -22,6 +22,10 @@ export declare enum StrokeJoin {
|
|
22
22
|
}
|
23
23
|
export declare const isPaint: (obj: SkJSIInstance<string> | null) => obj is SkPaint;
|
24
24
|
export interface SkPaint extends SkJSIInstance<"Paint"> {
|
25
|
+
/**
|
26
|
+
* Retrieves alpha from the color used when stroking and filling.
|
27
|
+
*/
|
28
|
+
getAlphaf(): number;
|
25
29
|
/**
|
26
30
|
* Returns a copy of this paint.
|
27
31
|
*/
|
@@ -4,7 +4,7 @@ import type { SkRuntimeEffect, SkRuntimeShaderBuilder } from "../RuntimeEffect";
|
|
4
4
|
export declare const isShader: (obj: SkJSIInstance<string> | null) => obj is SkShader;
|
5
5
|
export declare type SkShader = SkJSIInstance<"Shader">;
|
6
6
|
export declare type UniformValue = number | Vector | readonly number[];
|
7
|
-
export declare type Uniform = UniformValue | readonly UniformValue[];
|
7
|
+
export declare type Uniform = UniformValue | readonly UniformValue[] | Float32Array;
|
8
8
|
export interface Uniforms {
|
9
9
|
[name: string]: Uniform;
|
10
10
|
}
|
@@ -5,6 +5,7 @@ export declare class JsiSkPaint extends HostObject<Paint, "Paint"> implements Sk
|
|
5
5
|
constructor(CanvasKit: CanvasKit, ref: Paint);
|
6
6
|
copy(): JsiSkPaint;
|
7
7
|
reset(): void;
|
8
|
+
getAlphaf(): number;
|
8
9
|
getColor(): Float32Array;
|
9
10
|
getStrokeCap(): number;
|
10
11
|
getStrokeJoin(): number;
|
@@ -4,7 +4,9 @@ import type { SkRuntimeEffect } from "../types/RuntimeEffect/RuntimeEffect";
|
|
4
4
|
import { HostObject } from "./Host";
|
5
5
|
import { JsiSkShader } from "./JsiSkShader";
|
6
6
|
export declare class JsiSkRuntimeEffect extends HostObject<RuntimeEffect, "RuntimeEffect"> implements SkRuntimeEffect {
|
7
|
-
|
7
|
+
private sksl;
|
8
|
+
constructor(CanvasKit: CanvasKit, ref: RuntimeEffect, sksl: string);
|
9
|
+
source(): string;
|
8
10
|
makeShader(uniforms: number[], localMatrix?: SkMatrix): JsiSkShader;
|
9
11
|
makeShaderWithChildren(uniforms: number[], children?: SkShader[], localMatrix?: SkMatrix): JsiSkShader;
|
10
12
|
getUniform(index: number): import("canvaskit-wasm").SkSLUniform;
|
package/package.json
CHANGED
@@ -141,7 +141,7 @@ export abstract class JsiRenderNode<P extends GroupProps>
|
|
141
141
|
opacity !== undefined ||
|
142
142
|
antiAlias !== undefined
|
143
143
|
) {
|
144
|
-
ctx = {};
|
144
|
+
ctx = { opacity: 1 };
|
145
145
|
if (color !== undefined) {
|
146
146
|
ctx.color = this.Skia.Color(color);
|
147
147
|
}
|
@@ -208,24 +208,19 @@ export abstract class JsiRenderNode<P extends GroupProps>
|
|
208
208
|
const { invertClip, layer, matrix, transform } = this.props;
|
209
209
|
const { canvas } = parentCtx;
|
210
210
|
|
211
|
-
const opacity =
|
212
|
-
this.props.opacity !== undefined
|
213
|
-
? parentCtx.opacity * this.props.opacity
|
214
|
-
: parentCtx.opacity;
|
215
|
-
|
216
211
|
if (
|
217
212
|
this.paintCache === null ||
|
218
213
|
this.paintCache.parent !== parentCtx.paint
|
219
214
|
) {
|
220
215
|
const paintCtx = this.getPaintCtx();
|
221
216
|
const child = paintCtx
|
222
|
-
? concatPaint(parentCtx.paint, paintCtx
|
217
|
+
? concatPaint(parentCtx.paint.copy(), paintCtx)
|
223
218
|
: parentCtx.paint;
|
224
219
|
this.paintCache = { parent: parentCtx.paint, child };
|
225
220
|
}
|
226
221
|
const paint = this.paintCache.child;
|
227
222
|
// TODO: can we only recreate a new context here if needed?
|
228
|
-
const ctx = { ...parentCtx,
|
223
|
+
const ctx = { ...parentCtx, paint };
|
229
224
|
const hasTransform = matrix !== undefined || transform !== undefined;
|
230
225
|
const hasClip =
|
231
226
|
this.clipRect !== undefined ||
|
@@ -267,7 +262,7 @@ export abstract class JsiRenderNode<P extends GroupProps>
|
|
267
262
|
}
|
268
263
|
|
269
264
|
const concatPaint = (
|
270
|
-
|
265
|
+
paint: SkPaint,
|
271
266
|
{
|
272
267
|
color,
|
273
268
|
strokeWidth,
|
@@ -278,23 +273,21 @@ const concatPaint = (
|
|
278
273
|
imageFilter,
|
279
274
|
maskFilter,
|
280
275
|
pathEffect,
|
281
|
-
opacity
|
276
|
+
opacity,
|
282
277
|
strokeCap,
|
283
278
|
strokeJoin,
|
284
279
|
strokeMiter,
|
285
280
|
style,
|
286
|
-
}: PaintContext
|
287
|
-
opacity: number
|
281
|
+
}: PaintContext
|
288
282
|
) => {
|
289
|
-
|
283
|
+
if (opacity !== undefined) {
|
284
|
+
paint.setAlphaf(paint.getAlphaf() * opacity);
|
285
|
+
}
|
290
286
|
if (color !== undefined) {
|
287
|
+
const currentOpacity = paint.getAlphaf();
|
291
288
|
paint.setShader(null);
|
292
|
-
color[3] *= opacity;
|
293
289
|
paint.setColor(color);
|
294
|
-
|
295
|
-
const cl = paint.getColor();
|
296
|
-
cl[3] = opacity;
|
297
|
-
paint.setColor(cl);
|
290
|
+
paint.setAlphaf(currentOpacity * paint.getAlphaf());
|
298
291
|
}
|
299
292
|
if (strokeWidth !== undefined) {
|
300
293
|
paint.setStrokeWidth(strokeWidth);
|
@@ -320,9 +313,6 @@ const concatPaint = (
|
|
320
313
|
if (pathEffect !== undefined) {
|
321
314
|
paint.setPathEffect(pathEffect);
|
322
315
|
}
|
323
|
-
if (alpha !== undefined) {
|
324
|
-
paint.setAlphaf(alpha * opacity);
|
325
|
-
}
|
326
316
|
if (strokeCap !== undefined) {
|
327
317
|
paint.setStrokeCap(strokeCap);
|
328
318
|
}
|
@@ -16,7 +16,7 @@ const isRectCtor = (def: RectDef): def is RectCtor =>
|
|
16
16
|
|
17
17
|
export const processRect = (Skia: Skia, def: RectDef) => {
|
18
18
|
if (isRectCtor(def)) {
|
19
|
-
return Skia.XYWHRect(def.x, def.y, def.width, def.height);
|
19
|
+
return Skia.XYWHRect(def.x ?? 0, def.y ?? 0, def.width, def.height);
|
20
20
|
} else {
|
21
21
|
return def.rect;
|
22
22
|
}
|
@@ -24,9 +24,9 @@ export const processRect = (Skia: Skia, def: RectDef) => {
|
|
24
24
|
|
25
25
|
export const processRRect = (Skia: Skia, def: RRectDef) => {
|
26
26
|
if (isRRectCtor(def)) {
|
27
|
-
const r = processRadius(Skia, def.r);
|
27
|
+
const r = processRadius(Skia, def.r ?? 0);
|
28
28
|
return Skia.RRectXY(
|
29
|
-
Skia.XYWHRect(def.x, def.y, def.width, def.height),
|
29
|
+
Skia.XYWHRect(def.x ?? 0, def.y ?? 0, def.width, def.height),
|
30
30
|
r.x,
|
31
31
|
r.y
|
32
32
|
);
|
@@ -5,7 +5,6 @@ import { DeclarationType, NodeType } from "../../types";
|
|
5
5
|
import type { BoxShadowProps, BoxProps } from "../../types/Drawings";
|
6
6
|
import type { NodeContext } from "../Node";
|
7
7
|
import { JsiDeclarationNode } from "../Node";
|
8
|
-
import { processColor } from "../datatypes";
|
9
8
|
import { JsiRenderNode } from "../RenderNode";
|
10
9
|
|
11
10
|
const inflate = (
|
@@ -54,8 +53,9 @@ export class BoxNode extends JsiRenderNode<BoxProps> {
|
|
54
53
|
super(ctx, NodeType.Box, props);
|
55
54
|
}
|
56
55
|
|
57
|
-
renderNode({ canvas, paint
|
56
|
+
renderNode({ canvas, paint }: DrawingContext) {
|
58
57
|
const { box: defaultBox } = this.props;
|
58
|
+
const opacity = paint.getAlphaf();
|
59
59
|
const box = isRRect(defaultBox)
|
60
60
|
? defaultBox
|
61
61
|
: this.Skia.RRectXY(defaultBox, 0, 0);
|
@@ -72,7 +72,8 @@ export class BoxNode extends JsiRenderNode<BoxProps> {
|
|
72
72
|
.map((shadow) => {
|
73
73
|
const { color = "black", blur, spread = 0, dx = 0, dy = 0 } = shadow;
|
74
74
|
const lPaint = this.Skia.Paint();
|
75
|
-
lPaint.setColor(
|
75
|
+
lPaint.setColor(this.Skia.Color(color));
|
76
|
+
lPaint.setAlphaf(paint.getAlphaf() * opacity);
|
76
77
|
lPaint.setMaskFilter(
|
77
78
|
this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)
|
78
79
|
);
|
@@ -92,7 +93,9 @@ export class BoxNode extends JsiRenderNode<BoxProps> {
|
|
92
93
|
canvas.save();
|
93
94
|
canvas.clipRRect(box, ClipOp.Intersect, false);
|
94
95
|
const lPaint = this.Skia.Paint();
|
95
|
-
lPaint.setColor(
|
96
|
+
lPaint.setColor(this.Skia.Color(color));
|
97
|
+
lPaint.setAlphaf(paint.getAlphaf() * opacity);
|
98
|
+
|
96
99
|
lPaint.setMaskFilter(
|
97
100
|
this.Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)
|
98
101
|
);
|
@@ -14,7 +14,8 @@ export class ImageNode extends JsiDrawingNode<
|
|
14
14
|
}
|
15
15
|
|
16
16
|
deriveProps() {
|
17
|
-
const { image
|
17
|
+
const { image } = this.props;
|
18
|
+
const fit = this.props.fit ?? "contain";
|
18
19
|
const rect = processRect(this.Skia, this.props);
|
19
20
|
const { src, dst } = fitRects(
|
20
21
|
fit,
|