Created
March 2, 2018 21:26
-
-
Save lonekorean/6d923f269e2ff48ceef936e1e10bee0f to your computer and use it in GitHub Desktop.
Placeholder box paint worklet
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
class PlaceholderBoxPainter { | |
paint(ctx, size) { | |
ctx.lineWidth = 2; | |
ctx.strokeStyle = '#666'; | |
// draw line from top left to bottom right | |
ctx.beginPath(); | |
ctx.moveTo(0, 0); | |
ctx.lineTo(size.width, size.height); | |
ctx.stroke(); | |
// draw line from top right to bottom left | |
ctx.beginPath(); | |
ctx.moveTo(size.width, 0); | |
ctx.lineTo(0, size.height); | |
ctx.stroke(); | |
} | |
} | |
registerPaint('placeholder-box', PlaceholderBoxPainter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment