fix text rotation with offset
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user