Created
May 13, 2021 18:08
-
-
Save scottlow/a5ef9bb203495ab592dd4cb113ffa98e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Request a new delegated ink trail presenter | |
let presenter = await navigator.ink.requestPresenter('delegated-ink-trail', canvas); | |
// On pointer move, pass in a stroke style for OS to render | |
window.addEventListener('pointermove', evt => { | |
renderStrokeSegment(evt); | |
let style = { color: 'rgba(0, 0, 255, 1)', diameter: 5 }; | |
presenter.updateInkTrailStartPoint(evt, style); | |
}); | |
renderStrokeSegment(event) { | |
// application specific code to draw | |
// the stroke on 2D Canvas for example | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment