多次调用 setTransfrom 的问题?

发布于 6 年前作者 ping2916747 次浏览最后编辑 6 年前来自 ask

貌似 setTransfrom 真机的表现和模拟器中的表现不一致。

onLoad() {
        this.context = wx.createCanvasContext("surface");
         
        for ( var i = 0; i < 4; ++i ) {
            this.context.save();
            this.context.setTransform(1, 0, 0, 1, 100 * i, 100 * i);
            this.context.fillStyle = "rgba(0, 200, 0, 0.5)";
            this.context.fillRect(0, 0, 100, 100);
            this.context.fill();
            this.context.restore();
        }
         
        this.context.draw();
}

模拟器效果:

真机效果:

0 回复
暂无回复