Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Bugfix: Fix strokeline props #74

Merged
merged 2 commits into from
Sep 13, 2022
Merged

Bugfix: Fix strokeline props #74

merged 2 commits into from
Sep 13, 2022

Conversation

djmetzle
Copy link
Contributor

@djmetzle djmetzle commented Sep 13, 2022

The strokeLineCap and strokeLineJoin properties we are using for our custom stroke implementation do not match the Canvas API properties for the same.
Ref: (Fabric): http://fabricjs.com/docs/fabric.Line.html#strokeLineCap
This seems to match the SVG name for that property:
Ref: (MDN SVGs): https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap
But not the Canvas API for the same:
Ref: (MDN CanvasRC2D): https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap

This repairs the nice rounded edges (for lines, and the drop highlight) for our lines, caps, and rectangles.

Examples

master branch

66CCFF node test

66CCFF node test

lines node test

lines node test

simple-lines node test

simple-lines node test

Ref: https://github.com/iFixit/ifixit/issues/43782

CC @iFixit/devops

Our render hasn't been including nice rounded edges. This adds the
needed translation from Fabric to plain canvas ctx draw functions. We
can also default these properties to ensure they're always reasonable
for use.
In the previous commit, we've set default values for these stroke
properties in our custom highlighted stroke. As we're now duplicating
the default, these can go.
@djmetzle djmetzle added the bug label Sep 13, 2022
Copy link
Member

@danielbeardsley danielbeardsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR 👍

@djmetzle djmetzle merged commit 69fd774 into master Sep 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants