UNPKG

laya-coreui-es

Version:

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

45 lines (44 loc) 1.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DrawPieCmd = void 0; const Pool_1 = require("../../utils/Pool"); class DrawPieCmd { static create(x, y, radius, startAngle, endAngle, fillColor, lineColor, lineWidth, vid) { var cmd = Pool_1.Pool.getItemByClass("DrawPieCmd", DrawPieCmd); cmd.x = x; cmd.y = y; cmd.radius = radius; cmd._startAngle = startAngle; cmd._endAngle = endAngle; cmd.fillColor = fillColor; cmd.lineColor = lineColor; cmd.lineWidth = lineWidth; cmd.vid = vid; return cmd; } recover() { this.fillColor = null; this.lineColor = null; Pool_1.Pool.recover("DrawPieCmd", this); } run(context, gx, gy) { context._drawPie(this.x + gx, this.y + gy, this.radius, this._startAngle, this._endAngle, this.fillColor, this.lineColor, this.lineWidth, this.vid); } get cmdID() { return DrawPieCmd.ID; } get startAngle() { return this._startAngle * 180 / Math.PI; } set startAngle(value) { this._startAngle = value * Math.PI / 180; } get endAngle() { return this._endAngle * 180 / Math.PI; } set endAngle(value) { this._endAngle = value * Math.PI / 180; } } exports.DrawPieCmd = DrawPieCmd; DrawPieCmd.ID = "DrawPie";