UNPKG

laya-coreui-es

Version:

laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改

31 lines (30 loc) 987 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DrawRectCmd = void 0; const Pool_1 = require("../../utils/Pool"); class DrawRectCmd { static create(x, y, width, height, fillColor, lineColor, lineWidth) { var cmd = Pool_1.Pool.getItemByClass("DrawRectCmd", DrawRectCmd); cmd.x = x; cmd.y = y; cmd.width = width; cmd.height = height; cmd.fillColor = fillColor; cmd.lineColor = lineColor; cmd.lineWidth = lineWidth; return cmd; } recover() { this.fillColor = null; this.lineColor = null; Pool_1.Pool.recover("DrawRectCmd", this); } run(context, gx, gy) { context.drawRect(this.x + gx, this.y + gy, this.width, this.height, this.fillColor, this.lineColor, this.lineWidth); } get cmdID() { return DrawRectCmd.ID; } } exports.DrawRectCmd = DrawRectCmd; DrawRectCmd.ID = "DrawRect";