Git Product home page Git Product logo

Comments (13)

vadermemo avatar vadermemo commented on April 28, 2024 12

@magicismight This is June, 2018 and the snippet

<Line
x1={0}
x2={100}
y1={0}
y2={0}
stroke="black"
strokeWidth={2}
strokeLinecap="round" // < ---- doesn't work
/>

Doesn't work!

from react-native-svg.

magicismight avatar magicismight commented on April 28, 2024 1

We use strokeLinecap instead of strokeCap.
Because stroke-linecap is a valid svg attribute not stroke-cap.
And it is supported on [email protected] both android and iOS.

from react-native-svg.

magicismight avatar magicismight commented on April 28, 2024 1

qq 20160423215027

strokeLinecap works fine on android.
You can try the example code.

import Svg, {
    Path,
    Rect,
    G,
    Defs,
    Stop,
    RadialGradient,
    Polyline,
    ClipPath,
    Circle,
    Text
} from 'react-native-svg';

<Svg height="80" width="225">
            <G fill="none" stroke="black">
                <Path strokeLinecap="butt" strokeWidth="8" d="M5 20 l215 0" />
                <Path strokeLinecap="round" strokeWidth="8" d="M5 40 l215 0" />
                <Path strokeLinecap="square" strokeWidth="8" d="M5 60 l215 0" />
            </G>
</Svg>

Maybe you imported the elements from the old react-native-art-svg instead of react-native-svg?

from react-native-svg.

magicismight avatar magicismight commented on April 28, 2024 1

Which component did you used?
And the art module issue is fixed by now,
Thx for reporting this to me.
I will release those fixes to npm by next Monday.

from react-native-svg.

magicismight avatar magicismight commented on April 28, 2024 1

Good find!
👍
Get it be fixed in last commit

from react-native-svg.

magicismight avatar magicismight commented on April 28, 2024

BTW
This package has changed name to react-native-svg now.
And it is no longer based on ReactNativeART

from react-native-svg.

LightningK0ala avatar LightningK0ala commented on April 28, 2024

Hey thanks for the feedback. I upgraded to react-native-svg but had to manually install the "art" npm module. It's not very clear in the instructions that it is needed. Also I've made a pull request because patternReg.js was missing.

The linecaps are default to square now, but I'm still not able to change them with the <Line> component. 😞

from react-native-svg.

magicismight avatar magicismight commented on April 28, 2024

Which react-native-svg version did you installed?
And did you install by npm2? or npm3?

from react-native-svg.

LightningK0ala avatar LightningK0ala commented on April 28, 2024

[email protected] and npm2 (2.14.7)

from react-native-svg.

LightningK0ala avatar LightningK0ala commented on April 28, 2024

Oh it seems like Github omitted my <Line> string from a previous comment, so I have to escape with code formatting... Anyway I tried using Path like you suggested and strokeLinecap works! So it seems the problem is that this property is not working for <Line> component?

from react-native-svg.

LightningK0ala avatar LightningK0ala commented on April 28, 2024

It's the <Line>component that has issues.
I'm glad to help, by the way great job on this package!

Here's an example:

<Line
            x1={0}
            x2={100}
            y1={0}
            y2={0}
            stroke="black"
            strokeWidth={2}
            strokeLinecap="round"    // < ---- doesn't work
            />

from react-native-svg.

magicismight avatar magicismight commented on April 28, 2024

I will fix this soon.

from react-native-svg.

raymondxie avatar raymondxie commented on April 28, 2024

This is Nov. 2023, with [email protected], the strokeLinecap="round" still does not work for Line or Path

from react-native-svg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.