[]求问sprite放大后,graphics绘制的图像位置偏移

let sprite: Sprite = new Sprite();
let texture: Laya.Texture = Laya.loader.getRes(this.skin_img1);
sprite.graphics.drawTexture(texture, 0, 0, texture.width, texture.height);
sprite.size(texture.width, texture.height);
let x: number = 300;
let y: number = 100;
let scaleRatio: number = 1.3;
sprite.pos(x, y);
// sprite.graphics.drawCircle(texture.width/2, texture.height/2, 10, "#fff333"); //位置偏移
sprite.graphics.drawCircle(texture.width/2 - x/scaleRatio, texture.height/2 - y/scaleRatio, 10, "#fff333"); //位置正确
sprite.scale(scaleRatio, scaleRatio);
Laya.stage.addChild(sprite);
console.log(sprite.width);
console.log(sprite.height);

比如我在一个sprite的中心画一个圆,用scale放大后,圆偏离中心。
必须在原位置减去位置除以缩放比才能达到想要的效果。
2B487C3A-7FEB-4325-9D84-885C2019C7DC.png

cuixueying

赞同来自:

已经修复,1.7.10beta版本已经改好,请下载最新版本引擎进行使用即可!

cuixueying

赞同来自:

已经确认,是webGL导致的问题,我们已经安排修复,谢谢反馈!

sun9278888

赞同来自:

1.7.9_beta版也有这个问题的

该问题目前已经被锁定, 无法添加新回复

商务合作
商务合作