Commit Graph

386 Commits

Author SHA1 Message Date
Mikael Sand 38310677e3 Fix hit testing when using react-native transform arrays. 2018-10-24 02:21:46 +03:00
Mikael Sand 9affd59b00 Fix path parser spec conformance
https://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands
The "moveto" commands (M or m) must establish a new initial point
 and a new current point.
2018-10-24 00:03:02 +03:00
Mikael Sand 0c37a0c5e8 [android] Remove outdated references to shadow nodes in errors etc. 2018-10-22 19:06:18 +03:00
Mikael Sand 13b91aab39 [android] Add null checks before calling Matrix.mapRect 2018-10-22 16:28:22 +03:00
Mikael Sand 31d9bb9f41 [android] Reuse return value of paint.getTextSize() in Brushes 2018-10-19 02:48:19 +03:00
Mikael Sand 44744bc1f3 [android] Fix percentage handling in SVGLength 2018-10-19 01:16:09 +03:00
Mikael Sand 2a449c3bd4 [android] Implement fast path for SVGLength css value resolution 2018-10-18 19:44:42 +03:00
Mikael Sand 50eee0abe7 Optimize setting properties and animation: Implement SVGLength
Removes redundant round-trip (double > string > double) when animating.
Optimizes for the case when dynamic arguments are numbers.
Improves memory consumption and cpu load.
2018-10-18 17:56:07 +03:00
Mikael Sand 50905d83ef [android] Remove outdated comments 2018-10-17 17:53:30 +03:00
Mikael Sand e341b9499e [android] Simplify RenderableView, remove propertyNameToFieldName 2018-10-15 15:47:52 +03:00
Mikael Sand 585acee281 [android] Fix RenderableViewManager inheritance hierarchy 2018-10-15 05:26:45 +03:00
Mikael Sand 31d1a7459a [android] Add opacity and responsible ReactProp to RenderableViewManager 2018-10-15 04:51:06 +03:00
Mikael Sand be2041c84a [android] Fix font and font-size inheritance
Fixes remaining issues, em based units behave correctly now.
2018-10-15 04:29:23 +03:00
Mikael Sand 8dfabb5375 [android] Override LayoutShadowNode layout prop handlers.
Fix mergeProperties for groups and text.
Some regressions with edge cases of inheritance still remain.
2018-10-15 03:41:48 +03:00
Mikael Sand e9e2454b06 [android] Remove SvgViewShadowNode 2018-10-15 02:27:59 +03:00
Mikael Sand 585e34bea9 [android] Simplify SvgPackage 2018-10-15 02:23:45 +03:00
Mikael Sand a4e4b2af7c [android] Remove traverseChildren, NodeRunnable, SvgViewShadowNode
Simplify RenderableViewManager, SvgView
Remove redundant generics
2018-10-15 01:19:47 +03:00
Mikael Sand 0bdca66e2d [android] Refactor: Remove custom shadow nodes and move logic into Views 2018-10-14 22:10:33 +03:00
Mikael Sand 2f1d6e1b7c [android] Cache font size and canvas diagonal. Reuse reactTag value. 2018-10-14 18:40:15 +03:00
Mikael Sand bd50941204 [android] Simplify dynamic property setters, handle null better 2018-10-14 17:51:50 +03:00
Mikael Sand b94bb0558a [android] Utilize generics to remove unchecked type-cast. lint & cleanup 2018-10-14 09:56:26 +03:00
Mikael Sand 349c3b3367 Rebase pull request #807 from agustin107/master
Update README.md, changing dependency configuration for Android platform
2018-10-12 16:04:59 +03:00
Mikael Sand 864d7610d3 Support useNativeDriver animation for all unit-less numbers 2018-10-12 01:52:11 +03:00
Mikael Sand a2550c35df Fix null handling of getSvgShadowNode in new ancestor creation 2018-10-12 00:01:04 +03:00
Mikael Sand 445780c121 Simplify native animation and setNativeProps
Remove need for prefixed property names:
{use,mask,image,bb,pattern,rect}{width,height}
Can simply use width and height instead, and,
 x and y instead of position{X,Y} on Text and TSpan
2018-10-11 18:39:15 +03:00
Mikael Sand 95cdcb0834 [android] Move style transform property handler to RenderableViewManager 2018-10-11 07:39:10 +03:00
Mikael Sand fb4e877c2b Implement useNativeDriver support for animation of transform style 2018-10-11 07:09:12 +03:00
Mikael Sand a87096d3ee Implement useNativeDriver support for animation of some text properties 2018-10-11 04:19:12 +03:00
Mikael Sand 2a43579404 Implement support for animation of transform and some text properties 2018-10-11 03:31:47 +03:00
Mikael Sand b568a633ed [android] Fix svg root hit testing when no touch handlers are set. 2018-10-11 01:30:47 +03:00
Mikael Sand 70bde1495b [android] Fix stroke hit testing 2018-10-11 00:59:38 +03:00
Mikael Sand e307eeee57 Fixes for animation of width and height 2018-10-10 22:35:25 +03:00
Mikael Sand b13e164e22 Fix Removing child elements causes crash
https://github.com/react-native-community/react-native-svg/issues/789
2018-10-10 20:38:53 +03:00
Mikael Sand 032541b2bf Fix Svg root hitTest 2018-10-10 20:26:40 +03:00
Mikael Sand 4f5c226ef8 Support setting dimensions of Svg using stylesheet.
[android] Support borders on Svg root
2018-10-05 03:54:56 +03:00
Mikael Sand 1827b91883 First attempt at partial currentColor support 2018-10-04 22:17:18 +03:00
Mikael Sand ad99f97c84 Fix onPress/In/Out and responder handling 2018-09-24 01:41:30 +03:00
Mikael Sand 35597ed772 [android] Support other elements than Path as href in TextPath 2018-09-22 13:11:28 +03:00
Niko Rehnbäck 2219317513 Let SvgViewManager handle removing node and view references. 2018-09-18 16:09:52 +03:00
Mikael Sand 24c375fe43 Remove android.support.annotation.RequiresApi 2018-09-16 02:19:22 +03:00
Mikael Sand 2dae34054a Fix merge issue: https://github.com/react-native-community/react-native-svg/issues/778 2018-09-15 21:20:38 +03:00
Mikael Sand bf3fc3d677 Merge pull request #746 from msand/emoji
Implement basic support for unicode emoji
2018-09-15 19:11:17 +03:00
Mikael Sand c39b3267f1 [android] Only render once per frame when animating several svg nodes. 2018-09-15 19:03:28 +03:00
Mikael Sand 7e42a99cf3 Clear cached data in tree when changing properties on root svg element.
Fixes staleness issues when changing width and height.
2018-09-13 01:29:15 +03:00
Mikael Sand b88cba85a4 [iOS] Fix transform in mask handling
cleanup mask implementation
2018-09-12 02:59:38 +03:00
Mikael Sand 46307ecd2d Implement basic support for Mask element
iOS luminanceToAlpha calculation seems off
probably some color space or gamma issue
2018-09-12 01:48:39 +03:00
Mikael Sand fc63635f3c Implement basic support for Pattern element 2018-09-02 16:06:44 +03:00
Mikael Sand 7bb1e748b7 [android] Fix clipping path on Android < Kitkat (API 19) 2018-09-01 16:41:03 +03:00
Mikael Sand a1097b8594 Fix spec conformance of clipping path with multiple child elements.
https://www.w3.org/TR/SVG11/masking.html#EstablishingANewClippingPath

The raw geometry of each child element exclusive of rendering properties such as ‘fill’, ‘stroke’, ‘stroke-width’ within a ‘clipPath’ conceptually defines a 1-bit mask (with the possible exception of anti-aliasing along the edge of the geometry) which represents the silhouette of the graphics associated with that element. Anything outside the outline of the object is masked out. If a child element is made invisible by ‘display’ or ‘visibility’ it does not contribute to the clipping path. When the ‘clipPath’ element contains multiple child elements, the silhouettes of the child elements are logically OR'd together to create a single silhouette which is then used to restrict the region onto which paint can be applied. Thus, a point is inside the clipping path if it is inside any of the children of the ‘clipPath’.

For a given graphics element, the actual clipping path used will be the intersection of the clipping path specified by its ‘clip-path’ property (if any) with any clipping paths on its ancestors, as specified by the ‘clip-path’ property on the ancestor elements, or by the ‘overflow’ property on ancestor elements which establish a new viewport. Also, see the discussion of the initial clipping path.)

Fixes issues highlighted by https://github.com/react-native-community/react-native-svg/issues/752
Fix https://github.com/react-native-community/react-native-svg/issues/280
Fix https://github.com/react-native-community/react-native-svg/issues/517

[android] Fix https://github.com/react-native-community/react-native-svg/issues/766
`Region.Op.REPLACE` is deprecated in API level 28
Replace with clipPath (Path path) to Intersect instead.
2018-09-01 02:55:36 +03:00
Mikael Sand 8e0420fc2d [android] Fix caching of text 2018-08-25 01:06:45 +03:00