在panel中放入一个设置遮罩的对象,旋转并移动该对象,显示就出现异常,要么超出panel显示,要么显示一部分或者消失,测试代码如下
export default class ClipView extends Laya.Sprite {
constructor() {
super();
this.init();
}
init() {
let bg = new Laya.Sprite();
bg.graphics.drawRect(0, 0, 500, 500, '#aaa');
this.addChild(bg);
this.panel = new Laya.Panel();
this.panel.width = 500;
this.panel.height = 500;
this.panel.vScrollBarSkin = '';
this.panel.hScrollBarSkin = '';
this.addChild(this.panel);
let line = new Laya.Sprite();
line.size(1000, 20);
line.pos(200, 200);
line.graphics.drawRect(0, 0, 1000, 20, '#ccc');
line.rotation = 45;
line.scrollRect = new Laya.Rectangle(0, 0, 800, 20);
this.panel.addChild(line);
}
}
此时线条没有被panel裁切,完全显示出来,拖动panel,线条会出现消失问题
附件:
ClipDemo.rar