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

fix: transform polygon/polyline points to screen space #849

Merged
merged 1 commit into from Jan 14, 2022
Merged

Conversation

wodeni
Copy link
Member

@wodeni wodeni commented Jan 14, 2022

Description

Fixes: #724

The points property for Polyline and Polygon are currently passthrough properties. This PR adds attrPolyPoints for transforming a list of points to screen coordinates.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new ESLint warnings

@codecov
Copy link

codecov bot commented Jan 14, 2022

Codecov Report

Merging #849 (1221f83) into main (2b00441) will decrease coverage by 0.06%.
The diff coverage is 11.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #849      +/-   ##
==========================================
- Coverage   69.08%   69.01%   -0.07%     
==========================================
  Files          62       62              
  Lines        7821     7830       +9     
  Branches     1459     1459              
==========================================
+ Hits         5403     5404       +1     
- Misses       2405     2413       +8     
  Partials       13       13              
Impacted Files Coverage Δ
packages/core/src/renderer/Polygon.ts 25.00% <0.00%> (-2.28%) ⬇️
packages/core/src/renderer/Polyline.ts 25.00% <0.00%> (-2.28%) ⬇️
packages/core/src/shapes/Polygon.ts 100.00% <ø> (ø)
packages/core/src/shapes/Polyline.ts 100.00% <ø> (ø)
packages/core/src/renderer/AttrHelper.ts 83.75% <14.28%> (-3.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b00441...1221f83. Read the comment docs.

@wodeni wodeni merged commit 861447f into main Jan 14, 2022
@wodeni wodeni deleted the polygon-pts branch January 14, 2022 20:22
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

Successfully merging this pull request may close these issues.

Polygon points are relative to top-left of canvas, not origin
1 participant