-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native animation, ClipPath spec conformance, Pattern element, Mask element, cache invalidation #757
Merged
msand
merged 26 commits into
software-mansion:master
from
msand:NativeAnimationExperiment
Sep 15, 2018
Merged
Native animation, ClipPath spec conformance, Pattern element, Mask element, cache invalidation #757
msand
merged 26 commits into
software-mansion:master
from
msand:NativeAnimationExperiment
Sep 15, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mirror ReactNativeART facebook/react-native#9486
import React, { Component } from 'react'; import { StyleSheet, View, Dimensions, Animated } from 'react-native'; import { Svg, Rect } from 'react-native-svg'; const { width, height } = Dimensions.get('window'); const AnimatedRect = Animated.createAnimatedComponent(Rect); export default class App extends Component { state = { anim: new Animated.Value(0), }; componentDidMount() { Animated.timing(this.state.anim, { toValue: 1, duration: 3000, useNativeDriver: true, }).start(); } render() { const { anim } = this.state; return ( <View style={styles.container}> <Svg width={width} height={height} viewBox="0 0 100 100"> <AnimatedRect x="5" y="5" width="90" height="90" fill="green" fillOpacity={anim} /> </Svg> </View> ); } } const styles = StyleSheet.create({ container: { backgroundColor: '#ecf0f1', }, });
# Conflicts: # android/src/main/java/com/horcrux/svg/RenderableShadowNode.java # android/src/main/java/com/horcrux/svg/SvgViewShadowNode.java # elements/Image.js # elements/Rect.js # elements/Use.js # lib/attributes.js
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 software-mansion#752 Fix software-mansion#280 Fix software-mansion#517 [android] Fix software-mansion#766 `Region.Op.REPLACE` is deprecated in API level 28 Replace with clipPath (Path path) to Intersect instead.
iOS luminanceToAlpha calculation seems off probably some color space or gamma issue
cleanup mask implementation
Fixes staleness issues when changing width and height.
msand
changed the title
Native animation experiment
Native animation, ClipPath spec conformance, Pattern element, Mask element
Sep 15, 2018
msand
changed the title
Native animation, ClipPath spec conformance, Pattern element, Mask element
Native animation, ClipPath spec conformance, Pattern element, Mask element, cache invalidation
Sep 15, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requires facebook/react-native#18187 for useNativeDriver: true to work with string interpolation