-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
The scenario:
This one's simple. I'd like to create a repeated checkerboard pattern (for transparency background). The best way to do it in Konva seems to be using a Shape's repeating fill pattern with a simple 2x2 checkerboard image (and scaled using scaleX/Y).
The problem:
However, since Konva creates a dummy context to generate the fill pattern, it does not respect the image smoothing setting of the original Shape node or the parent Layer, and there seems to be no way to change that via config. The generate checkerboard fill pattern therefore looks very blurry due to bilinear interpolation scaled up from a 2x2 image when it should be a nearest-pixel interpolation.
The solution:
- Simply use the Shape node's image smoothing setting when creating the dummy context.
- Allow a separate fill-image-smoothing property that's used with the dummy context.
Solution 2 should be non-breaking.
Can submit a PR if needed.
Metadata
Metadata
Assignees
Labels
No labels