fix fill patter scale for text. close #720

This commit is contained in:
Anton Lavrenov
2020-09-14 16:37:25 -05:00
parent 37466422d8
commit 44f79edbbb
6 changed files with 24 additions and 25 deletions

View File

@@ -676,7 +676,7 @@ export class SceneContext extends Context {
}
if (fillPatternScaleX || fillPatternScaleY) {
this.scale(fillPatternScaleX, fillPatternScaleY);
// this.scale(fillPatternScaleX, fillPatternScaleY);
}
if (fillPatternOffsetX || fillPatternOffsetY) {

View File

@@ -242,15 +242,16 @@ export class Shape<Config extends ShapeConfig = ShapeConfig> extends Node<
this.fillPatternImage(),
this.fillPatternRepeat() || 'repeat'
);
// TODO: how to enable it? It doesn't work in FF...
// pattern.setTransform({
// a: this.fillPatternScaleX(), // Horizontal scaling. A value of 1 results in no scaling.
// b: 0, // Vertical skewing.
// c: 0, // Horizontal skewing.
// d: this.fillPatternScaleY(), // Vertical scaling. A value of 1 results in no scaling.
// e: 0, // Horizontal translation (moving).
// f: 0 // Vertical translation (moving).
// });
if (pattern && pattern.setTransform) {
pattern.setTransform({
a: this.fillPatternScaleX(), // Horizontal scaling. A value of 1 results in no scaling.
b: 0, // Vertical skewing.
c: 0, // Horizontal skewing.
d: this.fillPatternScaleY(), // Vertical scaling. A value of 1 results in no scaling.
e: 0, // Horizontal translation (moving).
f: 0, // Vertical translation (moving).
});
}
return pattern;
}
}