Merge pull request #13981 from mike-000/immediate-text

Fix immediate renderer text rotation with offset
This commit is contained in:
Tim Schaub
2022-08-16 20:04:48 -06:00
committed by GitHub
3 changed files with 124 additions and 12 deletions

View File

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