-
-
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
how to get same image inside two circles which are overlapping in middle #1233
Comments
Can you try with the latest commit from the develop branch, and setting clipRule="nonzero" on the ClipPath element? You can add something like clipPath=" " to the ClipPath element to workaround the prop extraction logic i just found like this: https://snack.expo.io/@msand/workaround-clippath-clip-rule-parsing import * as React from 'react';
import { Text, View, StyleSheet, ImageBackground } from 'react-native';
import { Svg, Defs, ClipPath, Circle, Image, G } from 'react-native-svg';
import Constants from 'expo-constants';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Svg height="100%" width="100%">
<Defs>
<ClipPath id="clip" clipRule="nonzero" clipPath=" ">
<Circle cx="80" cy="150" r="180" />
<Circle cx="320" cy="230" r="250" />
</ClipPath>
</Defs>
<Image
href={require('./assets/snack-icon.png')}
width={500}
height={500}
preserveAspectRatio="xMinYMin slice"
clipPath="url(#clip)"
/>
</Svg>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1',
padding: 8,
},
}); |
# [9.14.0](v9.13.6...v9.14.0) (2020-01-04) ### Bug Fixes * **android:** correct values for measureInWindow, fixes [#1231](#1231) ([3bf07f8](3bf07f8)) * **android:** elements not touchable if below opacity limit ([ebc7220](ebc7220)), closes [#1200](#1200) * **android:** fix radial gradient vertical center offset scaling ([d5bddd5](d5bddd5)) * **ios:** crash when offset is outside range [#1201](#1201) ([a2ef51f](a2ef51f)) * **web:** fix gesture responder dimensions measurement ([36c20b3](36c20b3)) * extraction of clip rule, fixes [#1233](#1233) ([f93bdde](f93bdde)) * Text color doesn't work with inlineSize [#1225](#1225) ([027b8c1](027b8c1)) ### Features * **android:** support using other native views in e.g. masks ([15b4ac6](15b4ac6)) * **ios:** support using other native views in e.g. masks ([518a3b1](518a3b1)) * **web:** Implement support for event, touch & responder handlers ([60561ec](60561ec)) * **web:** Optimize: only set responders if press handler exists ([23250ad](23250ad)) * Implement display="none" ([3e3ad13](3e3ad13)), closes [#1220](#1220)
🎉 This issue has been resolved in version 9.14.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Released in v10 |
This issue is still present in v12.3.0 (currently recommended by expo). |
This can be worked around using a |
hello,
i am trying to create a component in which one small circle overlaps another big circle in middle and Image tag is used to show same background in both the circles with clip path but here issue is
image is not shown in overlapping parts of circles. please help i have image attached about the same.
demo image
this is my code
The text was updated successfully, but these errors were encountered: