mirror of
https://github.com/konvajs/konva.git
synced 2026-01-24 05:45:14 +08:00
fix fill patter scale for text. close #720
This commit is contained in:
@@ -676,7 +676,7 @@ export class SceneContext extends Context {
|
||||
}
|
||||
|
||||
if (fillPatternScaleX || fillPatternScaleY) {
|
||||
this.scale(fillPatternScaleX, fillPatternScaleY);
|
||||
// this.scale(fillPatternScaleX, fillPatternScaleY);
|
||||
}
|
||||
|
||||
if (fillPatternOffsetX || fillPatternOffsetY) {
|
||||
|
||||
19
src/Shape.ts
19
src/Shape.ts
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user