Skip to content
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

Inconsistent rendering of circle on Android and IOS #2174

Closed
lit26 opened this issue Nov 10, 2023 · 1 comment
Closed

Inconsistent rendering of circle on Android and IOS #2174

lit26 opened this issue Nov 10, 2023 · 1 comment
Labels
Close when stale This issue is going to be closed when there is no activity for a while

Comments

@lit26
Copy link

lit26 commented Nov 10, 2023

Question

Hi, the rendering of nested svg is inconsistent between Android and ios.

To Reproduce

import Svg, {Circle} from 'react-native-svg';

import React from 'react';
import {View} from 'react-native';

export default class SvgExample extends React.Component {
  render() {
    const size = 224.1;
    const strokeWidth = 22.41;
    const progressPercent = 40;
    const radius = (size - strokeWidth) / 2;
    const circum = radius * 2 * Math.PI;
    const svgProgress = 100 - progressPercent;
    const margin = 10;
    return (
      <View style={{position: 'absolute', height: 300, width: 300, top: 90}}>
        <Svg height="100%" width="100%" viewBox="0 0 100 100">
          <View style={{margin}}>
            <Svg width={size} height={size}>
              <Circle
                stroke={'blue'}
                fill="none"
                cx={size / 2}
                cy={size / 2}
                r={radius}
                strokeDasharray={`${circum} ${circum}`}
                strokeDashoffset={radius * Math.PI * 2 * (svgProgress / 100)}
                strokeLinecap="round"
                transform={`rotate(135, ${size / 2}, ${size / 2})`}
                strokeWidth={strokeWidth}
              />
            </Svg>
          </View>
        </Svg>
      </View>
    );
  }
}

Android pixel 2 screenshot
Screen Shot 2023-11-10 at 3 40 17 PM
IOS 12 screenshot
Simulator Screen Shot - iPhone 12 - 2023-11-10 at 15 40 11

Thank you

@bohdanprog
Copy link
Member

bohdanprog commented Jun 11, 2024

Hello @lit26, I tried to reproduce that issue but couldn't.

IOS ANDROID

If you still have that issue, feel free to reopen that issue.
thank you.

@bohdanprog bohdanprog added maybe fixed Close when stale This issue is going to be closed when there is no activity for a while and removed maybe fixed labels Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close when stale This issue is going to be closed when there is no activity for a while
Projects
None yet
Development

No branches or pull requests

2 participants