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

Point symbols only render correctly when x and y values are whole numbers #753

Closed
cbranch101 opened this issue Sep 18, 2017 · 4 comments
Closed
Assignees

Comments

@cbranch101
Copy link
Contributor

Something strange seems to be going on with the path functions that render symbols inside of point

<Point symbol="diamond"/>
screen shot 2017-09-18 at 10 53 56 am

<Point symbol="plus"/>
screen shot 2017-09-18 at 10 54 08 am
"/>

The only shape that seems to work correctly is circle

An example of how I'm providing the point component

<VictoryScatter
    dataComponent={
        <Point
            symbol="plus"
            shapeRendering="auto"
            style={{ fill: "black" }}
        />
    }
/>

@cbranch101
Copy link
Contributor Author

In fact you can see the same problem in the demo in the docs for Victory Scatter

Both the square and circle are warped

screen shot 2017-09-21 at 12 10 33 pm

@cbranch101
Copy link
Contributor Author

After some digging, I think this only happens when the x or y values for the point aren't a whole number

@cbranch101 cbranch101 changed the title Garbled shapes when providing symbol prop to Point Point symbols only render correctly when x and y values are whole numbers Sep 21, 2017
@boygirl
Copy link
Contributor

boygirl commented Sep 21, 2017

@cbranch101 thank you for looking into this. We started rounding path values to prevent sub-pixel rendering, but I think this is causing error and distortion.

@boygirl boygirl self-assigned this Sep 21, 2017
@cbranch101
Copy link
Contributor Author

@boygirl Yep, I think that's what it was. PR inbound to victory-core that I think will address this.

cbranch101 added a commit to cbranch101/victory-core that referenced this issue Sep 22, 2017
…e math.floor and fixes the path helper functions that were dependant on the old rounding behavior
cbranch101 added a commit to cbranch101/victory-core that referenced this issue Sep 22, 2017
…e math.floor and fixes the path helper functions that were dependent on the old rounding behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants