Closed bynormous closed 4 years ago
Are you using SVG or canvas?
If SVG, then you need to recompute the pattern at different sizes, because a repeat pattern would loop choppy.
I'm working on a new version that does not do any pattern fills but It may take some time before it's ready for release.
Just realized it's not a canvas/svg issue but using the Path object. I suspect you are using SVG Path and not Rectangle for this. RIght?
I think I'm using rectangle and using canvas:
this.rough.rectangle(0, 0, this.el.w, this.el.h, {
fill: this.el.fill,
fillStyle: 'dots',
stroke: 'black',
seed: 1
})
I am using matrix transformations using ctx.setTransform to set the position/scale/rotation of my elements. I think that might be why I'm running into more trouble than most people?
This bug isn't critical btw, I'm just playing around with the library. Thanks for your help!
Excalidraw.com uses transform as well for such stuff (not using dots though) and haven't heard this issue there. If you have a simple example, I can take a look.
Here's an example: https://codepen.io/psomo/pen/NWGqWWw using the latest roughjs
When I tried an old v3 version of roughjs the bug actually went away
This was indeed a dumb bug that was caused by an unrelated issue due to a hasty (and bad) decision I made some time ago. Haha. Fixed in a big refactor I did: https://github.com/pshihn/rough/pull/144 Fix Available is v4.2.0
it looks like the pattern scales with the rectangle until it's 200x200 then it gets capped. See gif above. Also, the render time increases dramatically after 200x200. See gif. I'm just rendering a simple rectangle with fillStyle = 'dots'