Open grafmouse opened 5 years ago
This is a known issue and one of the reason why we do no have scaling patterns at all in fabricJS. But i need to do some fixes for the scaling stroke, maybe we can fix this too.
the point here is that we have to dynamically create a new pattern based on the old one transformed, so that we do not have to scale the context.
Text has a different fill / stroke logic compare to everything else. Would be different if we could draw text as a path efficently.
I'm having the same issue, would like to see a fix as well :)
Another issue, pattern becomes blurry when patternTransform is [1/scaleX, 0, 0, 1/scaleY, 0, 0] http://jsfiddle.net/0wmhpj5b/1/
Can't see the pattern loading in your fiddle... Ok is a chrome issue, in Firefox the fiddle works correctly.
The way text work is very different from shapes. In order for a pattern to be scaled independently of text on the canvas, we need to transform it in a bigger or smaller pattern at pixel level. So blurryness is something that we have to live with.
Version
2.6.0
Test Case
http://jsfiddle.net/nhwmj1pa/
Information about environment
Browser: latest Chrome and Safari
Steps to reproduce
Expected Behavior
Text filled with scaled down pattern.
Actual Behavior
Pattern is wrong. Text paths are ignored. Pattern does not repeat itself.
No scale defined in patternTransform:
Scale defined in patternTransform: