fix text rotation with offset

This commit is contained in:
mike-000
2022-08-14 19:36:04 +01:00
committed by GitHub
parent adc9a5318e
commit 0bea162f87

View File

@@ -386,18 +386,9 @@ class CanvasImmediateRenderer extends VectorContext {
this.textScale_[0] != 1 || this.textScale_[0] != 1 ||
this.textScale_[1] != 1 this.textScale_[1] != 1
) { ) {
const localTransform = composeTransform( context.translate(x - this.textOffsetX_, y - this.textOffsetY_);
this.tmpLocalTransform_, context.rotate(rotation);
x, context.translate(this.textOffsetX_, this.textOffsetY_);
y,
1,
1,
rotation,
-x,
-y
);
context.setTransform.apply(context, localTransform);
context.translate(x, y);
context.scale(this.textScale_[0], this.textScale_[1]); context.scale(this.textScale_[0], this.textScale_[1]);
if (this.textStrokeState_) { if (this.textStrokeState_) {
context.strokeText(this.text_, 0, 0); context.strokeText(this.text_, 0, 0);