Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有fabric.Pattern(图像)的织物对象。当我缩放对象时,填充图案质量缺失(非常差)。
fabric.Pattern
缩放对象时有什么方法可以提高图案质量?
当我缩放对象时,有什么方法可以重复模式吗?
我认为这将解决您的问题:
canvas.observe("object:scaling", function (e) { var shape = e.target; shape.width = shape.scaleX * shape.width; shape.height = shape.scaleY * shape.height; shape.scaleX = 1; shape.scaleY = 1; });
如果您使用缩放,您可以保留变量scaleX并scaleY在调整大小后恢复它们(而不是 make 它们1)。
scaleX
scaleY
1