laya-coreui-es
Version:
laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改
22 lines (21 loc) • 578 B
JavaScript
import { Pool } from "../../utils/Pool";
export class ClipRectCmd {
static create(x, y, width, height) {
var cmd = Pool.getItemByClass("ClipRectCmd", ClipRectCmd);
cmd.x = x;
cmd.y = y;
cmd.width = width;
cmd.height = height;
return cmd;
}
recover() {
Pool.recover("ClipRectCmd", this);
}
run(context, gx, gy) {
context.clipRect(this.x + gx, this.y + gy, this.width, this.height);
}
get cmdID() {
return ClipRectCmd.ID;
}
}
ClipRectCmd.ID = "ClipRect";