@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.
Files changed (303) hide show
  1. package/cpp/api/JsiSkPaint.h +6 -0
  2. package/cpp/api/JsiSkRuntimeEffect.h +7 -2
  3. package/cpp/jsi/JsiHostObject.h +25 -25
  4. package/cpp/rnskia/RNSkDomView.cpp +1 -1
  5. package/cpp/rnskia/RNSkPlatformContext.h +2 -6
  6. package/cpp/rnskia/dom/base/DrawingContext.cpp +23 -41
  7. package/cpp/rnskia/dom/base/DrawingContext.h +6 -19
  8. package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +12 -2
  9. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +4 -4
  10. package/cpp/rnskia/dom/base/JsiDomNode.h +68 -10
  11. package/cpp/rnskia/dom/base/JsiDomRenderNode.h +26 -61
  12. package/cpp/rnskia/dom/base/NodeProp.h +2 -1
  13. package/cpp/rnskia/dom/base/NodePropsContainer.h +10 -0
  14. package/cpp/rnskia/dom/nodes/JsiBlendNode.h +1 -2
  15. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +3 -6
  16. package/cpp/rnskia/dom/nodes/JsiBoxNode.h +2 -4
  17. package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +1 -2
  18. package/cpp/rnskia/dom/nodes/JsiCircleNode.h +2 -5
  19. package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +4 -8
  20. package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +2 -5
  21. package/cpp/rnskia/dom/nodes/JsiDiffRectNode.h +2 -7
  22. package/cpp/rnskia/dom/nodes/JsiGlyphsNode.h +4 -8
  23. package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +20 -38
  24. package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -1
  25. package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +2 -4
  26. package/cpp/rnskia/dom/nodes/JsiLineNode.h +2 -7
  27. package/cpp/rnskia/dom/nodes/JsiOvalNode.h +1 -3
  28. package/cpp/rnskia/dom/nodes/JsiPaintNode.h +2 -3
  29. package/cpp/rnskia/dom/nodes/JsiPatchNode.h +4 -8
  30. package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +14 -28
  31. package/cpp/rnskia/dom/nodes/JsiPathNode.h +6 -16
  32. package/cpp/rnskia/dom/nodes/JsiPictureNode.h +1 -2
  33. package/cpp/rnskia/dom/nodes/JsiPointsNode.h +2 -5
  34. package/cpp/rnskia/dom/nodes/JsiRRectNode.h +1 -2
  35. package/cpp/rnskia/dom/nodes/JsiRectNode.h +1 -2
  36. package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +37 -69
  37. package/cpp/rnskia/dom/nodes/JsiTextBlobNode.h +3 -6
  38. package/cpp/rnskia/dom/nodes/JsiTextNode.h +4 -8
  39. package/cpp/rnskia/dom/nodes/JsiTextPathNode.h +1 -2
  40. package/cpp/rnskia/dom/nodes/JsiVerticesNode.h +2 -4
  41. package/cpp/rnskia/dom/props/CircleProp.h +2 -0
  42. package/cpp/rnskia/dom/props/ColorProp.h +9 -4
  43. package/cpp/rnskia/dom/props/ImageProps.h +3 -2
  44. package/cpp/rnskia/dom/props/PaintProps.h +15 -7
  45. package/cpp/rnskia/dom/props/RectProp.h +11 -4
  46. package/cpp/rnskia/dom/props/TransformProp.h +0 -2
  47. package/cpp/rnskia/dom/props/UniformsProp.h +86 -123
  48. package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -6
  49. package/cpp/utils/RNSkLog.h +1 -1
  50. package/lib/commonjs/dom/nodes/RenderNode.js +12 -16
  51. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  52. package/lib/commonjs/dom/nodes/datatypes/Circle.js +6 -1
  53. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
  54. package/lib/commonjs/dom/nodes/datatypes/Rect.js +3 -3
  55. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  56. package/lib/commonjs/dom/nodes/datatypes/index.js +0 -13
  57. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
  58. package/lib/commonjs/dom/nodes/drawings/Box.js +6 -6
  59. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  60. package/lib/commonjs/dom/nodes/drawings/ImageNode.js +2 -2
  61. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +1 -1
  62. package/lib/commonjs/dom/nodes/drawings/PatchNode.js +3 -7
  63. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
  64. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +1 -1
  65. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
  66. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +1 -3
  67. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
  68. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +1 -1
  69. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  70. package/lib/commonjs/dom/nodes/paint/Shaders.js +1 -3
  71. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
  72. package/lib/commonjs/dom/types/Common.js.map +1 -1
  73. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  74. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  75. package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
  76. package/lib/commonjs/renderer/components/Mask.js +2 -6
  77. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  78. package/lib/commonjs/renderer/components/image/Image.js +0 -5
  79. package/lib/commonjs/renderer/components/image/Image.js.map +1 -1
  80. package/lib/commonjs/renderer/components/image/ImageShader.js +20 -10
  81. package/lib/commonjs/renderer/components/image/ImageShader.js.map +1 -1
  82. package/lib/commonjs/renderer/components/imageFilters/Blur.js +10 -5
  83. package/lib/commonjs/renderer/components/imageFilters/Blur.js.map +1 -1
  84. package/lib/commonjs/renderer/components/imageFilters/Morphology.js +10 -5
  85. package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
  86. package/lib/commonjs/renderer/components/imageFilters/Offset.js +12 -6
  87. package/lib/commonjs/renderer/components/imageFilters/Offset.js.map +1 -1
  88. package/lib/commonjs/renderer/components/maskFilters/Blur.js +12 -6
  89. package/lib/commonjs/renderer/components/maskFilters/Blur.js.map +1 -1
  90. package/lib/commonjs/renderer/components/pathEffects/Discrete.js +10 -5
  91. package/lib/commonjs/renderer/components/pathEffects/Discrete.js.map +1 -1
  92. package/lib/commonjs/renderer/components/shaders/FractalNoise.js +14 -7
  93. package/lib/commonjs/renderer/components/shaders/FractalNoise.js.map +1 -1
  94. package/lib/commonjs/renderer/components/shaders/Shader.js +10 -5
  95. package/lib/commonjs/renderer/components/shaders/Shader.js.map +1 -1
  96. package/lib/commonjs/renderer/components/shaders/Turbulence.js +14 -7
  97. package/lib/commonjs/renderer/components/shaders/Turbulence.js.map +1 -1
  98. package/lib/commonjs/renderer/components/shapes/Circle.js +0 -6
  99. package/lib/commonjs/renderer/components/shapes/Circle.js.map +1 -1
  100. package/lib/commonjs/renderer/components/shapes/FitBox.js +1 -4
  101. package/lib/commonjs/renderer/components/shapes/FitBox.js.map +1 -1
  102. package/lib/commonjs/renderer/components/shapes/Oval.js +0 -4
  103. package/lib/commonjs/renderer/components/shapes/Oval.js.map +1 -1
  104. package/lib/commonjs/renderer/components/shapes/Path.js +12 -6
  105. package/lib/commonjs/renderer/components/shapes/Path.js.map +1 -1
  106. package/lib/commonjs/renderer/components/shapes/Points.js +10 -5
  107. package/lib/commonjs/renderer/components/shapes/Points.js.map +1 -1
  108. package/lib/commonjs/renderer/components/shapes/RoundedRect.js +0 -3
  109. package/lib/commonjs/renderer/components/shapes/RoundedRect.js.map +1 -1
  110. package/lib/commonjs/renderer/components/shapes/Vertices.js +10 -5
  111. package/lib/commonjs/renderer/components/shapes/Vertices.js.map +1 -1
  112. package/lib/commonjs/renderer/components/text/Glyphs.js +12 -6
  113. package/lib/commonjs/renderer/components/text/Glyphs.js.map +1 -1
  114. package/lib/commonjs/renderer/components/text/Text.js +12 -6
  115. package/lib/commonjs/renderer/components/text/Text.js.map +1 -1
  116. package/lib/commonjs/renderer/components/text/TextBlob.js +12 -6
  117. package/lib/commonjs/renderer/components/text/TextBlob.js.map +1 -1
  118. package/lib/commonjs/renderer/components/text/TextPath.js +10 -5
  119. package/lib/commonjs/renderer/components/text/TextPath.js.map +1 -1
  120. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  121. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  122. package/lib/commonjs/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  123. package/lib/commonjs/skia/types/Shader/Shader.js +3 -2
  124. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  125. package/lib/commonjs/skia/web/JsiSkPaint.js +4 -0
  126. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  127. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -1
  128. package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  129. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
  130. package/lib/commonjs/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  131. package/lib/commonjs/web/LoadSkiaWeb.js +1 -1
  132. package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
  133. package/lib/module/dom/nodes/RenderNode.js +12 -16
  134. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  135. package/lib/module/dom/nodes/datatypes/Circle.js +8 -1
  136. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  137. package/lib/module/dom/nodes/datatypes/Rect.js +7 -3
  138. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  139. package/lib/module/dom/nodes/datatypes/index.js +0 -1
  140. package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
  141. package/lib/module/dom/nodes/drawings/Box.js +6 -5
  142. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  143. package/lib/module/dom/nodes/drawings/ImageNode.js +4 -2
  144. package/lib/module/dom/nodes/drawings/ImageNode.js.map +1 -1
  145. package/lib/module/dom/nodes/drawings/PatchNode.js +4 -8
  146. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
  147. package/lib/module/dom/nodes/drawings/VerticesNode.js +2 -2
  148. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
  149. package/lib/module/dom/nodes/paint/ColorFilters.js +1 -2
  150. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
  151. package/lib/module/dom/nodes/paint/ImageFilters.js +2 -2
  152. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  153. package/lib/module/dom/nodes/paint/Shaders.js +1 -2
  154. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  155. package/lib/module/dom/types/Common.js.map +1 -1
  156. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  157. package/lib/module/dom/types/Drawings.js.map +1 -1
  158. package/lib/module/renderer/DrawingContext.js.map +1 -1
  159. package/lib/module/renderer/components/Mask.js +2 -6
  160. package/lib/module/renderer/components/Mask.js.map +1 -1
  161. package/lib/module/renderer/components/image/Image.js +0 -5
  162. package/lib/module/renderer/components/image/Image.js.map +1 -1
  163. package/lib/module/renderer/components/image/ImageShader.js +20 -10
  164. package/lib/module/renderer/components/image/ImageShader.js.map +1 -1
  165. package/lib/module/renderer/components/imageFilters/Blur.js +10 -5
  166. package/lib/module/renderer/components/imageFilters/Blur.js.map +1 -1
  167. package/lib/module/renderer/components/imageFilters/Morphology.js +10 -5
  168. package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
  169. package/lib/module/renderer/components/imageFilters/Offset.js +12 -6
  170. package/lib/module/renderer/components/imageFilters/Offset.js.map +1 -1
  171. package/lib/module/renderer/components/maskFilters/Blur.js +12 -6
  172. package/lib/module/renderer/components/maskFilters/Blur.js.map +1 -1
  173. package/lib/module/renderer/components/pathEffects/Discrete.js +10 -5
  174. package/lib/module/renderer/components/pathEffects/Discrete.js.map +1 -1
  175. package/lib/module/renderer/components/shaders/FractalNoise.js +14 -7
  176. package/lib/module/renderer/components/shaders/FractalNoise.js.map +1 -1
  177. package/lib/module/renderer/components/shaders/Shader.js +10 -5
  178. package/lib/module/renderer/components/shaders/Shader.js.map +1 -1
  179. package/lib/module/renderer/components/shaders/Turbulence.js +14 -7
  180. package/lib/module/renderer/components/shaders/Turbulence.js.map +1 -1
  181. package/lib/module/renderer/components/shapes/Circle.js +0 -6
  182. package/lib/module/renderer/components/shapes/Circle.js.map +1 -1
  183. package/lib/module/renderer/components/shapes/FitBox.js +1 -4
  184. package/lib/module/renderer/components/shapes/FitBox.js.map +1 -1
  185. package/lib/module/renderer/components/shapes/Oval.js +0 -4
  186. package/lib/module/renderer/components/shapes/Oval.js.map +1 -1
  187. package/lib/module/renderer/components/shapes/Path.js +12 -6
  188. package/lib/module/renderer/components/shapes/Path.js.map +1 -1
  189. package/lib/module/renderer/components/shapes/Points.js +10 -5
  190. package/lib/module/renderer/components/shapes/Points.js.map +1 -1
  191. package/lib/module/renderer/components/shapes/RoundedRect.js +0 -3
  192. package/lib/module/renderer/components/shapes/RoundedRect.js.map +1 -1
  193. package/lib/module/renderer/components/shapes/Vertices.js +10 -5
  194. package/lib/module/renderer/components/shapes/Vertices.js.map +1 -1
  195. package/lib/module/renderer/components/text/Glyphs.js +12 -6
  196. package/lib/module/renderer/components/text/Glyphs.js.map +1 -1
  197. package/lib/module/renderer/components/text/Text.js +12 -6
  198. package/lib/module/renderer/components/text/Text.js.map +1 -1
  199. package/lib/module/renderer/components/text/TextBlob.js +12 -6
  200. package/lib/module/renderer/components/text/TextBlob.js.map +1 -1
  201. package/lib/module/renderer/components/text/TextPath.js +10 -5
  202. package/lib/module/renderer/components/text/TextPath.js.map +1 -1
  203. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  204. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  205. package/lib/module/skia/types/RuntimeEffect/RuntimeEffect.js.map +1 -1
  206. package/lib/module/skia/types/Shader/Shader.js +3 -2
  207. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  208. package/lib/module/skia/web/JsiSkPaint.js +4 -0
  209. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  210. package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -1
  211. package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
  212. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js +1 -1
  213. package/lib/module/skia/web/JsiSkRuntimeEffectFactory.js.map +1 -1
  214. package/lib/module/web/LoadSkiaWeb.js +1 -1
  215. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  216. package/lib/typescript/src/dom/nodes/datatypes/Circle.d.ts +4 -1
  217. package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +0 -1
  218. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +1 -1
  219. package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +1 -1
  220. package/lib/typescript/src/dom/types/Common.d.ts +4 -4
  221. package/lib/typescript/src/dom/types/DrawingContext.d.ts +0 -1
  222. package/lib/typescript/src/dom/types/Drawings.d.ts +1 -1
  223. package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -5
  224. package/lib/typescript/src/renderer/components/Mask.d.ts +3 -9
  225. package/lib/typescript/src/renderer/components/image/Image.d.ts +1 -8
  226. package/lib/typescript/src/renderer/components/image/ImageShader.d.ts +2 -12
  227. package/lib/typescript/src/renderer/components/imageFilters/Blur.d.ts +2 -7
  228. package/lib/typescript/src/renderer/components/imageFilters/Morphology.d.ts +2 -7
  229. package/lib/typescript/src/renderer/components/imageFilters/Offset.d.ts +2 -8
  230. package/lib/typescript/src/renderer/components/maskFilters/Blur.d.ts +2 -8
  231. package/lib/typescript/src/renderer/components/pathEffects/Discrete.d.ts +2 -7
  232. package/lib/typescript/src/renderer/components/shaders/FractalNoise.d.ts +2 -9
  233. package/lib/typescript/src/renderer/components/shaders/Shader.d.ts +2 -7
  234. package/lib/typescript/src/renderer/components/shaders/Turbulence.d.ts +2 -9
  235. package/lib/typescript/src/renderer/components/shapes/Circle.d.ts +1 -9
  236. package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +2 -7
  237. package/lib/typescript/src/renderer/components/shapes/Oval.d.ts +1 -7
  238. package/lib/typescript/src/renderer/components/shapes/Path.d.ts +2 -8
  239. package/lib/typescript/src/renderer/components/shapes/Points.d.ts +2 -7
  240. package/lib/typescript/src/renderer/components/shapes/RoundedRect.d.ts +1 -6
  241. package/lib/typescript/src/renderer/components/shapes/Vertices.d.ts +2 -7
  242. package/lib/typescript/src/renderer/components/text/Glyphs.d.ts +2 -8
  243. package/lib/typescript/src/renderer/components/text/Text.d.ts +2 -8
  244. package/lib/typescript/src/renderer/components/text/TextBlob.d.ts +2 -8
  245. package/lib/typescript/src/renderer/components/text/TextPath.d.ts +2 -7
  246. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +5 -0
  247. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +4 -0
  248. package/lib/typescript/src/skia/types/RuntimeEffect/RuntimeEffect.d.ts +4 -0
  249. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  250. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  251. package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +3 -1
  252. package/package.json +1 -1
  253. package/src/dom/nodes/RenderNode.ts +11 -21
  254. package/src/dom/nodes/datatypes/Circle.ts +1 -1
  255. package/src/dom/nodes/datatypes/Rect.ts +3 -3
  256. package/src/dom/nodes/datatypes/index.ts +0 -1
  257. package/src/dom/nodes/drawings/Box.ts +7 -4
  258. package/src/dom/nodes/drawings/ImageNode.ts +2 -1
  259. package/src/dom/nodes/drawings/PatchNode.ts +4 -18
  260. package/src/dom/nodes/drawings/VerticesNode.ts +2 -2
  261. package/src/dom/nodes/paint/ColorFilters.ts +1 -2
  262. package/src/dom/nodes/paint/ImageFilters.ts +2 -2
  263. package/src/dom/nodes/paint/Shaders.ts +1 -2
  264. package/src/dom/types/Common.ts +4 -4
  265. package/src/dom/types/DrawingContext.ts +0 -1
  266. package/src/dom/types/Drawings.ts +1 -1
  267. package/src/renderer/DrawingContext.ts +5 -5
  268. package/src/renderer/components/Mask.tsx +8 -8
  269. package/src/renderer/components/image/Image.tsx +0 -6
  270. package/src/renderer/components/image/ImageShader.tsx +24 -12
  271. package/src/renderer/components/imageFilters/Blur.tsx +6 -7
  272. package/src/renderer/components/imageFilters/Morphology.tsx +6 -7
  273. package/src/renderer/components/imageFilters/Offset.tsx +7 -8
  274. package/src/renderer/components/maskFilters/Blur.tsx +7 -8
  275. package/src/renderer/components/pathEffects/Discrete.tsx +6 -9
  276. package/src/renderer/components/shaders/FractalNoise.tsx +18 -9
  277. package/src/renderer/components/shaders/Shader.tsx +6 -7
  278. package/src/renderer/components/shaders/Turbulence.tsx +15 -9
  279. package/src/renderer/components/shapes/Circle.tsx +0 -4
  280. package/src/renderer/components/shapes/FitBox.tsx +2 -6
  281. package/src/renderer/components/shapes/Oval.tsx +0 -5
  282. package/src/renderer/components/shapes/Path.tsx +7 -8
  283. package/src/renderer/components/shapes/Points.tsx +6 -7
  284. package/src/renderer/components/shapes/RoundedRect.tsx +0 -4
  285. package/src/renderer/components/shapes/Vertices.tsx +6 -7
  286. package/src/renderer/components/text/Glyphs.tsx +7 -8
  287. package/src/renderer/components/text/Text.tsx +7 -8
  288. package/src/renderer/components/text/TextBlob.tsx +7 -8
  289. package/src/renderer/components/text/TextPath.tsx +6 -7
  290. package/src/renderer/processors/Animations/Animations.ts +9 -3
  291. package/src/skia/types/Paint/Paint.ts +5 -0
  292. package/src/skia/types/RuntimeEffect/RuntimeEffect.ts +5 -0
  293. package/src/skia/types/Shader/Shader.ts +5 -3
  294. package/src/skia/web/JsiSkPaint.ts +4 -0
  295. package/src/skia/web/JsiSkRuntimeEffect.ts +5 -1
  296. package/src/skia/web/JsiSkRuntimeEffectFactory.ts +1 -1
  297. package/src/web/LoadSkiaWeb.tsx +1 -1
  298. package/lib/commonjs/dom/nodes/datatypes/Color.js +0 -27
  299. package/lib/commonjs/dom/nodes/datatypes/Color.js.map +0 -1
  300. package/lib/module/dom/nodes/datatypes/Color.js +0 -11
  301. package/lib/module/dom/nodes/datatypes/Color.js.map +0 -1
  302. package/lib/typescript/src/dom/nodes/datatypes/Color.d.ts +0 -7
  303. package/src/dom/nodes/datatypes/Color.ts +0 -15
@@ -85,10 +85,8 @@ protected:
85
85
  void defineProperties(NodePropsContainer *container) override {
86
86
  JsiBaseDomDeclarationNode::defineProperties(container);
87
87
 
88
- _intervals = container->defineProperty(
89
- std::make_shared<NodeProp>(JsiPropId::get("intervals")));
90
- _phase = container->defineProperty(
91
- std::make_shared<NodeProp>(JsiPropId::get("phase")));
88
+ _intervals = container->defineProperty<NodeProp>("intervals");
89
+ _phase = container->defineProperty<NodeProp>("phase");
92
90
 
93
91
  _intervals->require();
94
92
  }
@@ -123,12 +121,9 @@ protected:
123
121
  void defineProperties(NodePropsContainer *container) override {
124
122
  JsiBaseDomDeclarationNode::defineProperties(container);
125
123
 
126
- _lengthProp = container->defineProperty(
127
- std::make_shared<NodeProp>(JsiPropId::get("length")));
128
- _deviationProp = container->defineProperty(
129
- std::make_shared<NodeProp>(JsiPropId::get("deviation")));
130
- _seedProp = container->defineProperty(
131
- std::make_shared<NodeProp>(JsiPropId::get("seed")));
124
+ _lengthProp = container->defineProperty<NodeProp>("length");
125
+ _deviationProp = container->defineProperty<NodeProp>("deviation");
126
+ _seedProp = container->defineProperty<NodeProp>("seed");
132
127
 
133
128
  _lengthProp->require();
134
129
  _deviationProp->require();
@@ -161,8 +156,7 @@ protected:
161
156
  void defineProperties(NodePropsContainer *container) override {
162
157
  JsiBaseDomDeclarationNode::defineProperties(container);
163
158
 
164
- _rProp = container->defineProperty(
165
- std::make_shared<NodeProp>(JsiPropId::get("r")));
159
+ _rProp = container->defineProperty<NodeProp>("r");
166
160
  _rProp->require();
167
161
  }
168
162
 
@@ -193,14 +187,10 @@ protected:
193
187
  void defineProperties(NodePropsContainer *container) override {
194
188
  JsiBaseDomDeclarationNode::defineProperties(container);
195
189
 
196
- _phaseProp = container->defineProperty(
197
- std::make_shared<NodeProp>(JsiPropId::get("phase")));
198
- _advanceProp = container->defineProperty(
199
- std::make_shared<NodeProp>(JsiPropId::get("advance")));
200
- _pathProp = container->defineProperty(
201
- std::make_shared<PathProp>(JsiPropId::get("path")));
202
- _styleProp = container->defineProperty(
203
- std::make_shared<NodeProp>(JsiPropId::get("style")));
190
+ _phaseProp = container->defineProperty<NodeProp>("phase");
191
+ _advanceProp = container->defineProperty<NodeProp>("advance");
192
+ _pathProp = container->defineProperty<PathProp>("path");
193
+ _styleProp = container->defineProperty<NodeProp>("style");
204
194
 
205
195
  _phaseProp->require();
206
196
  _advanceProp->require();
@@ -248,10 +238,8 @@ protected:
248
238
  void defineProperties(NodePropsContainer *container) override {
249
239
  JsiBaseDomDeclarationNode::defineProperties(container);
250
240
 
251
- _matrixProp = container->defineProperty(
252
- std::make_shared<MatrixProp>(JsiPropId::get("matrix")));
253
- _pathProp = container->defineProperty(
254
- std::make_shared<PathProp>(JsiPropId::get("path")));
241
+ _matrixProp = container->defineProperty<MatrixProp>("matrix");
242
+ _pathProp = container->defineProperty<PathProp>("path");
255
243
 
256
244
  _matrixProp->require();
257
245
  _pathProp->require();
@@ -283,10 +271,8 @@ protected:
283
271
  void defineProperties(NodePropsContainer *container) override {
284
272
  JsiBaseDomDeclarationNode::defineProperties(container);
285
273
 
286
- _matrixProp = container->defineProperty(
287
- std::make_shared<MatrixProp>(JsiPropId::get("matrix")));
288
- _widthProp = container->defineProperty(
289
- std::make_shared<NodeProp>(JsiPropId::get("width")));
274
+ _matrixProp = container->defineProperty<MatrixProp>("matrix");
275
+ _widthProp = container->defineProperty<NodeProp>("width");
290
276
 
291
277
  _matrixProp->require();
292
278
  _widthProp->require();
@@ -15,12 +15,7 @@
15
15
 
16
16
  namespace RNSkia {
17
17
 
18
- static PropId PropNamePath = JsiPropId::get("path");
19
- static PropId PropNameStart = JsiPropId::get("start");
20
- static PropId PropNameEnd = JsiPropId::get("end");
21
- static PropId PropNameFillType = JsiPropId::get("fillType");
22
18
  static PropId PropNameMiterLimit = JsiPropId::get("miter_limit");
23
- static PropId PropNameStroke = JsiPropId::get("stroke");
24
19
  static PropId PropNamePrecision = JsiPropId::get("precision");
25
20
 
26
21
  class JsiPathNode : public JsiDomDrawingNode,
@@ -132,16 +127,11 @@ protected:
132
127
 
133
128
  void defineProperties(NodePropsContainer *container) override {
134
129
  JsiDomDrawingNode::defineProperties(container);
135
- _pathProp =
136
- container->defineProperty(std::make_shared<PathProp>(PropNamePath));
137
- _startProp =
138
- container->defineProperty(std::make_shared<NodeProp>(PropNameStart));
139
- _endProp =
140
- container->defineProperty(std::make_shared<NodeProp>(PropNameEnd));
141
- _fillTypeProp =
142
- container->defineProperty(std::make_shared<NodeProp>(PropNameFillType));
143
- _strokeOptsProp =
144
- container->defineProperty(std::make_shared<NodeProp>(PropNameStroke));
130
+ _pathProp = container->defineProperty<PathProp>("path");
131
+ _startProp = container->defineProperty<NodeProp>("start");
132
+ _endProp = container->defineProperty<NodeProp>("end");
133
+ _fillTypeProp = container->defineProperty<NodeProp>("fillType");
134
+ _strokeOptsProp = container->defineProperty<NodeProp>("stroke");
145
135
 
146
136
  _pathProp->require();
147
137
  }
@@ -173,7 +163,7 @@ private:
173
163
  class StrokeOptsProps : public BaseDerivedProp {
174
164
  public:
175
165
  StrokeOptsProps() : BaseDerivedProp() {
176
- _strokeProp = addProperty(std::make_shared<NodeProp>(PropNameStroke));
166
+ _strokeProp = addProperty(std::make_shared<NodeProp>("stroke"));
177
167
  }
178
168
 
179
169
  private:
@@ -20,8 +20,7 @@ protected:
20
20
 
21
21
  void defineProperties(NodePropsContainer *container) override {
22
22
  JsiDomDrawingNode::defineProperties(container);
23
- _pictureProp = container->defineProperty(
24
- std::make_shared<PictureProp>(JsiPropId::get("picture")));
23
+ _pictureProp = container->defineProperty<PictureProp>("picture");
25
24
  _pictureProp->require();
26
25
  }
27
26
 
@@ -14,7 +14,6 @@
14
14
 
15
15
  namespace RNSkia {
16
16
 
17
- static PropId PropNamePoints = JsiPropId::get("points");
18
17
  static PropId PropNamePointsMode = JsiPropId::get("mode");
19
18
 
20
19
  class JsiPointsNode : public JsiDomDrawingNode,
@@ -34,10 +33,8 @@ protected:
34
33
 
35
34
  void defineProperties(NodePropsContainer *container) override {
36
35
  JsiDomDrawingNode::defineProperties(container);
37
- _pointModeProp = container->defineProperty(
38
- std::make_shared<PointModeProp>(PropNamePointsMode));
39
- _pointsProp =
40
- container->defineProperty(std::make_shared<PointsProp>(PropNamePoints));
36
+ _pointModeProp = container->defineProperty<PointModeProp>("mode");
37
+ _pointsProp = container->defineProperty<PointsProp>("points");
41
38
 
42
39
  _pointsProp->require();
43
40
  _pointModeProp->require();
@@ -22,8 +22,7 @@ protected:
22
22
  void defineProperties(NodePropsContainer *container) override {
23
23
  JsiDomDrawingNode::defineProperties(container);
24
24
 
25
- _rrectProp =
26
- container->defineProperty(std::make_shared<RRectProps>(PropNameRect));
25
+ _rrectProp = container->defineProperty<RRectProps>("rect");
27
26
  _rrectProp->require();
28
27
  }
29
28
 
@@ -22,8 +22,7 @@ protected:
22
22
  void defineProperties(NodePropsContainer *container) override {
23
23
  JsiDomDrawingNode::defineProperties(container);
24
24
 
25
- _rectProp =
26
- container->defineProperty(std::make_shared<RectProps>(PropNameRect));
25
+ _rectProp = container->defineProperty<RectProps>("rect");
27
26
  _rectProp->require();
28
27
  }
29
28
 
@@ -89,12 +89,10 @@ protected:
89
89
 
90
90
  void defineProperties(NodePropsContainer *container) override {
91
91
  JsiBaseDomDeclarationNode::defineProperties(container);
92
- _sourceProp = container->defineProperty(
93
- std::make_shared<NodeProp>(JsiPropId::get("source")));
94
- _uniformsProp = container->defineProperty(std::make_shared<UniformsProp>(
95
- JsiPropId::get("uniforms"), _sourceProp));
96
- _transformProp = container->defineProperty(
97
- std::make_shared<TransformProp>(JsiPropId::get("transform")));
92
+ _sourceProp = container->defineProperty<NodeProp>("source");
93
+ _uniformsProp =
94
+ container->defineProperty<UniformsProp>("uniforms", _sourceProp);
95
+ _transformProp = container->defineProperty<TransformProp>("transform");
98
96
 
99
97
  _sourceProp->require();
100
98
  }
@@ -141,18 +139,13 @@ protected:
141
139
 
142
140
  void defineProperties(NodePropsContainer *container) override {
143
141
  JsiBaseDomDeclarationNode::defineProperties(container);
144
- _txProp = container->defineProperty(
145
- std::make_shared<TileModeProp>(JsiPropId::get("tx")));
146
- _tyProp = container->defineProperty(
147
- std::make_shared<TileModeProp>(JsiPropId::get("ty")));
148
- _filterModeProp = container->defineProperty(
149
- std::make_shared<NodeProp>(JsiPropId::get("fm")));
150
- _mipmapModeProp = container->defineProperty(
151
- std::make_shared<NodeProp>(JsiPropId::get("mm")));
152
-
153
- _imageProps = container->defineProperty(std::make_shared<ImageProps>());
154
- _transformProp = container->defineProperty(
155
- std::make_shared<TransformProp>(JsiPropId::get("transform")));
142
+ _txProp = container->defineProperty<TileModeProp>("tx");
143
+ _tyProp = container->defineProperty<TileModeProp>("ty");
144
+ _filterModeProp = container->defineProperty<NodeProp>("fm");
145
+ _mipmapModeProp = container->defineProperty<NodeProp>("mm");
146
+
147
+ _imageProps = container->defineProperty<ImageProps>();
148
+ _transformProp = container->defineProperty<TransformProp>("transform");
156
149
 
157
150
  _txProp->require();
158
151
  _tyProp->require();
@@ -161,10 +154,8 @@ protected:
161
154
 
162
155
  _transformProp->require();
163
156
 
164
- // Just require the image
165
- container
166
- ->defineProperty(std::make_shared<NodeProp>(JsiPropId::get("image")))
167
- ->require();
157
+ // Add and require the image
158
+ container->defineProperty<NodeProp>("image")->require();
168
159
  }
169
160
 
170
161
  private:
@@ -221,8 +212,7 @@ protected:
221
212
 
222
213
  void defineProperties(NodePropsContainer *container) override {
223
214
  JsiBaseDomDeclarationNode::defineProperties(container);
224
- _colorProp = container->defineProperty(
225
- std::make_shared<ColorProp>(JsiPropId::get("color")));
215
+ _colorProp = container->defineProperty<ColorProp>("color");
226
216
  _colorProp->require();
227
217
  }
228
218
 
@@ -239,18 +229,12 @@ public:
239
229
  protected:
240
230
  void defineProperties(NodePropsContainer *container) override {
241
231
  JsiBaseDomDeclarationNode::defineProperties(container);
242
- _freqXProp = container->defineProperty(
243
- std::make_shared<NodeProp>(JsiPropId::get("freqX")));
244
- _freqYProp = container->defineProperty(
245
- std::make_shared<NodeProp>(JsiPropId::get("freqY")));
246
- _octavesProp = container->defineProperty(
247
- std::make_shared<NodeProp>(JsiPropId::get("octaves")));
248
- _seedProp = container->defineProperty(
249
- std::make_shared<NodeProp>(JsiPropId::get("seed")));
250
- _tileWidthProp = container->defineProperty(
251
- std::make_shared<NodeProp>(JsiPropId::get("tileWidth")));
252
- _tileHeightProp = container->defineProperty(
253
- std::make_shared<NodeProp>(JsiPropId::get("tileHeight")));
232
+ _freqXProp = container->defineProperty<NodeProp>("freqX");
233
+ _freqYProp = container->defineProperty<NodeProp>("freqY");
234
+ _octavesProp = container->defineProperty<NodeProp>("octaves");
235
+ _seedProp = container->defineProperty<NodeProp>("seed");
236
+ _tileWidthProp = container->defineProperty<NodeProp>("tileWidth");
237
+ _tileHeightProp = container->defineProperty<NodeProp>("tileHeight");
254
238
 
255
239
  _freqXProp->require();
256
240
  _freqYProp->require();
@@ -317,17 +301,12 @@ public:
317
301
 
318
302
  void defineProperties(NodePropsContainer *container) override {
319
303
  JsiBaseDomDeclarationNode::defineProperties(container);
320
- _transformsProps =
321
- container->defineProperty(std::make_shared<TransformsProps>());
322
-
323
- _colorsProp = container->defineProperty(
324
- std::make_shared<ColorsProp>(JsiPropId::get("colors")));
325
- _positionsProp = container->defineProperty(
326
- std::make_shared<NumbersProp>(JsiPropId::get("positions")));
327
- _modeProp = container->defineProperty(
328
- std::make_shared<TileModeProp>(JsiPropId::get("mode")));
329
- _flagsProp = container->defineProperty(
330
- std::make_shared<NodeProp>(JsiPropId::get("flags")));
304
+ _transformsProps = container->defineProperty<TransformsProps>();
305
+
306
+ _colorsProp = container->defineProperty<ColorsProp>("colors");
307
+ _positionsProp = container->defineProperty<NumbersProp>("positions");
308
+ _modeProp = container->defineProperty<TileModeProp>("mode");
309
+ _flagsProp = container->defineProperty<NodeProp>("flags");
331
310
 
332
311
  _colorsProp->require();
333
312
  }
@@ -385,10 +364,8 @@ protected:
385
364
 
386
365
  void defineProperties(NodePropsContainer *container) override {
387
366
  JsiBaseGradientNode::defineProperties(container);
388
- _startProp = container->defineProperty(
389
- std::make_shared<PointProp>(JsiPropId::get("start")));
390
- _endProp = container->defineProperty(
391
- std::make_shared<PointProp>(JsiPropId::get("end")));
367
+ _startProp = container->defineProperty<PointProp>("start");
368
+ _endProp = container->defineProperty<PointProp>("end");
392
369
 
393
370
  _startProp->require();
394
371
  _endProp->require();
@@ -420,10 +397,8 @@ protected:
420
397
 
421
398
  void defineProperties(NodePropsContainer *container) override {
422
399
  JsiBaseGradientNode::defineProperties(container);
423
- _centerProp = container->defineProperty(
424
- std::make_shared<PointProp>(JsiPropId::get("c")));
425
- _radiusProp = container->defineProperty(
426
- std::make_shared<NodeProp>(JsiPropId::get("r")));
400
+ _centerProp = container->defineProperty<PointProp>("c");
401
+ _radiusProp = container->defineProperty<NodeProp>("r");
427
402
 
428
403
  _centerProp->require();
429
404
  _radiusProp->require();
@@ -457,12 +432,9 @@ protected:
457
432
 
458
433
  void defineProperties(NodePropsContainer *container) override {
459
434
  JsiBaseGradientNode::defineProperties(container);
460
- _startProp = container->defineProperty(
461
- std::make_shared<NodeProp>(JsiPropId::get("start")));
462
- _endProp = container->defineProperty(
463
- std::make_shared<NodeProp>(JsiPropId::get("end")));
464
- _centerProp = container->defineProperty(
465
- std::make_shared<PointProp>(JsiPropId::get("c")));
435
+ _startProp = container->defineProperty<NodeProp>("start");
436
+ _endProp = container->defineProperty<NodeProp>("end");
437
+ _centerProp = container->defineProperty<PointProp>("c");
466
438
  }
467
439
 
468
440
  private:
@@ -497,14 +469,10 @@ protected:
497
469
 
498
470
  void defineProperties(NodePropsContainer *container) override {
499
471
  JsiBaseGradientNode::defineProperties(container);
500
- _startProp = container->defineProperty(
501
- std::make_shared<PointProp>(JsiPropId::get("start")));
502
- _startRProp = container->defineProperty(
503
- std::make_shared<NodeProp>(JsiPropId::get("startR")));
504
- _endProp = container->defineProperty(
505
- std::make_shared<PointProp>(JsiPropId::get("end")));
506
- _endRProp = container->defineProperty(
507
- std::make_shared<NodeProp>(JsiPropId::get("endR")));
472
+ _startProp = container->defineProperty<PointProp>("start");
473
+ _startRProp = container->defineProperty<NodeProp>("startR");
474
+ _endProp = container->defineProperty<PointProp>("end");
475
+ _endRProp = container->defineProperty<NodeProp>("endR");
508
476
  }
509
477
 
510
478
  private:
@@ -26,12 +26,9 @@ protected:
26
26
  void defineProperties(NodePropsContainer *container) override {
27
27
  JsiDomDrawingNode::defineProperties(container);
28
28
 
29
- _textBlobProp = container->defineProperty(
30
- std::make_shared<TextBlobProp>(JsiPropId::get("blob")));
31
- _xProp = container->defineProperty(
32
- std::make_shared<NodeProp>(JsiPropId::get("x")));
33
- _yProp = container->defineProperty(
34
- std::make_shared<NodeProp>(JsiPropId::get("y")));
29
+ _textBlobProp = container->defineProperty<TextBlobProp>("blob");
30
+ _xProp = container->defineProperty<NodeProp>("x");
31
+ _yProp = container->defineProperty<NodeProp>("y");
35
32
 
36
33
  _textBlobProp->require();
37
34
  _xProp->require();
@@ -29,14 +29,10 @@ protected:
29
29
  void defineProperties(NodePropsContainer *container) override {
30
30
  JsiDomDrawingNode::defineProperties(container);
31
31
 
32
- _fontProp = container->defineProperty(
33
- std::make_shared<FontProp>(JsiPropId::get("font")));
34
- _textProp = container->defineProperty(
35
- std::make_shared<NodeProp>(JsiPropId::get("text")));
36
- _xProp = container->defineProperty(
37
- std::make_shared<NodeProp>(JsiPropId::get("x")));
38
- _yProp = container->defineProperty(
39
- std::make_shared<NodeProp>(JsiPropId::get("y")));
32
+ _fontProp = container->defineProperty<FontProp>("font");
33
+ _textProp = container->defineProperty<NodeProp>("text");
34
+ _xProp = container->defineProperty<NodeProp>("x");
35
+ _yProp = container->defineProperty<NodeProp>("y");
40
36
 
41
37
  _fontProp->require();
42
38
  _textProp->require();
@@ -21,8 +21,7 @@ protected:
21
21
 
22
22
  void defineProperties(NodePropsContainer *container) override {
23
23
  JsiDomDrawingNode::defineProperties(container);
24
- _textBlobProp =
25
- container->defineProperty(std::make_shared<TextPathBlobProp>());
24
+ _textBlobProp = container->defineProperty<TextPathBlobProp>();
26
25
  }
27
26
 
28
27
  private:
@@ -29,10 +29,8 @@ protected:
29
29
 
30
30
  void defineProperties(NodePropsContainer *container) override {
31
31
  JsiDomDrawingNode::defineProperties(container);
32
- _verticesProps =
33
- container->defineProperty(std::make_shared<VerticesProps>());
34
- _blendModeProp = container->defineProperty(
35
- std::make_shared<BlendModeProp>(JsiPropId::get("blendMode")));
32
+ _verticesProps = container->defineProperty<VerticesProps>();
33
+ _blendModeProp = container->defineProperty<BlendModeProp>("blendMode");
36
34
  }
37
35
 
38
36
  private:
@@ -34,6 +34,8 @@ public:
34
34
  _cy->value().getAsNumber()));
35
35
  } else if (_c->isSet()) {
36
36
  setDerivedValue(_c->getDerivedValue());
37
+ } else {
38
+ setDerivedValue(SkPoint::Make(0.0, 0.0));
37
39
  }
38
40
  }
39
41
 
@@ -9,6 +9,11 @@
9
9
 
10
10
  namespace RNSkia {
11
11
 
12
+ static PropId PropName0 = JsiPropId::get("0");
13
+ static PropId PropName1 = JsiPropId::get("1");
14
+ static PropId PropName2 = JsiPropId::get("2");
15
+ static PropId PropName3 = JsiPropId::get("3");
16
+
12
17
  class ColorProp : public DerivedProp<SkColor> {
13
18
  public:
14
19
  explicit ColorProp(PropId name) : DerivedProp<SkColor>() {
@@ -28,10 +33,10 @@ public:
28
33
  static SkColor parseColorValue(const JsiValue &color) {
29
34
  if (color.getType() == PropType::Object) {
30
35
  // Float array
31
- auto r = color.getValue(JsiPropId::get("0"));
32
- auto g = color.getValue(JsiPropId::get("1"));
33
- auto b = color.getValue(JsiPropId::get("2"));
34
- auto a = color.getValue(JsiPropId::get("3"));
36
+ auto r = color.getValue(PropName0);
37
+ auto g = color.getValue(PropName1);
38
+ auto b = color.getValue(PropName2);
39
+ auto a = color.getValue(PropName3);
35
40
  return SkColorSetARGB(a.getAsNumber() * 255.0f, r.getAsNumber() * 255.0f,
36
41
  g.getAsNumber() * 255.0f, b.getAsNumber() * 255.0f);
37
42
 
@@ -30,7 +30,8 @@ public:
30
30
  }
31
31
 
32
32
  void updateDerivedValue() override {
33
- if (_imageProp->value().getType() != PropType::HostObject) {
33
+ if (!_imageProp->isSet() ||
34
+ _imageProp->value().getType() != PropType::HostObject) {
34
35
  throw std::runtime_error("Expected SkImage object for the " +
35
36
  std::string(getName()) + " property.");
36
37
  }
@@ -67,7 +68,7 @@ public:
67
68
 
68
69
  auto rect = _rectProp->getDerivedValue() ? *_rectProp->getDerivedValue()
69
70
  : imageRect;
70
- auto fit = _fitProp->isSet() ? _fitProp->value().getAsString() : "none";
71
+ auto fit = _fitProp->isSet() ? _fitProp->value().getAsString() : "contain";
71
72
 
72
73
  setDerivedValue(fitRects(fit, imageRect, rect));
73
74
  }
@@ -92,23 +92,31 @@ public:
92
92
 
93
93
  // Opacity
94
94
  if (_opacity->isChanged() || context->isChanged()) {
95
+ auto parent = context->getParent();
96
+ auto paint = context->getMutablePaint();
95
97
  if (_opacity->isSet()) {
96
- context->setOpacity(context->getOpacity() *
97
- _opacity->value().getAsNumber());
98
+ auto currentOpacity = _opacity->value().getAsNumber();
99
+ auto parent = context->getParent();
100
+ if (parent != nullptr) {
101
+ currentOpacity *= parent->getPaint()->getAlphaf();
102
+ }
103
+ paint->setAlphaf(currentOpacity);
98
104
  } else {
99
- context->clearOpacity();
105
+ if (parent != nullptr) {
106
+ paint->setAlphaf(parent->getPaint()->getAlphaf());
107
+ } else {
108
+ paint->setAlphaf(1.0);
109
+ }
100
110
  }
101
111
  }
102
112
 
103
113
  // COLOR
104
114
  if (_color->isSet() && (_color->isChanged() || context->isChanged())) {
105
115
  auto paint = context->getMutablePaint();
116
+ auto opacity = paint->getAlphaf();
106
117
  paint->setShader(nullptr);
107
118
  paint->setColor(*_color->getDerivedValue());
108
- paint->setAlphaf(context->getOpacity() * paint->getColor4f().fA);
109
- } else if (context->isChanged()) {
110
- auto paint = context->getMutablePaint();
111
- paint->setAlphaf(context->getOpacity());
119
+ paint->setAlphaf(opacity * paint->getColor4f().fA);
112
120
  }
113
121
 
114
122
  // Style
@@ -76,10 +76,17 @@ public:
76
76
  }
77
77
 
78
78
  void updateDerivedValue() override {
79
- if (_x->isSet() && _y->isSet() && _width->isSet() && _height->isSet()) {
80
- setDerivedValue(SkRect::MakeXYWH(
81
- _x->value().getAsNumber(), _y->value().getAsNumber(),
82
- _width->value().getAsNumber(), _height->value().getAsNumber()));
79
+ if (_width->isSet() && _height->isSet()) {
80
+ auto x = 0.0;
81
+ auto y = 0.0;
82
+ if (_x->isSet()) {
83
+ x = _x->value().getAsNumber();
84
+ }
85
+ if (_y->isSet()) {
86
+ y = _y->value().getAsNumber();
87
+ }
88
+ setDerivedValue(SkRect::MakeXYWH(x, y, _width->value().getAsNumber(),
89
+ _height->value().getAsNumber()));
83
90
  }
84
91
  }
85
92
 
@@ -8,8 +8,6 @@
8
8
 
9
9
  namespace RNSkia {
10
10
 
11
- static PropId PropNameTransform = JsiPropId::get("transform");
12
-
13
11
  static PropId PropNameTranslateX = JsiPropId::get("translateX");
14
12
  static PropId PropNameTranslateY = JsiPropId::get("translateY");
15
13
  static PropId PropNameScale = JsiPropId::get("scale");