Skip to content

Commit

Permalink
Fix an issue with the pixel ratio-aware line width
Browse files Browse the repository at this point in the history
  • Loading branch information
flekschas committed Dec 8, 2020
1 parent f86f0aa commit bb45e47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v0.3.1

- Precalculate `projection * view * model` for speed
- Pre-calculate `projection * view * model` for speed
- Fix an issue with the pixel ratio-aware line width

## v0.3.0

Expand Down
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ const createLine = (
colorTex: () => colorTex,
colorTexRes: () => colorTexRes,
colorTexEps: () => 0.5 / colorTexRes,
width: ({ viewportWidth }) =>
(width / viewportWidth) * window.devicePixelRatio,
pixelRatio: ({ pixelRatio }) => pixelRatio,
width: ({ pixelRatio, viewportHeight, viewportWidth }) =>
(width / Math.max(viewportWidth, viewportHeight)) * pixelRatio,
miter,
},
elements: () => elements,
Expand Down

0 comments on commit bb45e47

Please sign in to comment.