44 lines
1.7 KiB
JavaScript
44 lines
1.7 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$graphics$shared$buildCommands$buildRectangle = function(global, require, module, exports) {
|
|
global = require("module$node_modules$pixi_DOT_js$lib$extensions$Extensions");
|
|
"use strict";
|
|
exports.buildRectangle = {extension:{type:global.ExtensionType.ShapeBuilder, name:"rectangle"}, build(shape, points) {
|
|
const x = shape.x, y = shape.y, width = shape.width;
|
|
shape = shape.height;
|
|
if (!(0 < width && 0 < shape)) {
|
|
return !1;
|
|
}
|
|
points[0] = x;
|
|
points[1] = y;
|
|
points[2] = x + width;
|
|
points[3] = y;
|
|
points[4] = x + width;
|
|
points[5] = y + shape;
|
|
points[6] = x;
|
|
points[7] = y + shape;
|
|
return !0;
|
|
}, triangulate(points, vertices, verticesStride, verticesOffset, indices, indicesOffset) {
|
|
let count = 0;
|
|
verticesOffset *= verticesStride;
|
|
vertices[verticesOffset + count] = points[0];
|
|
vertices[verticesOffset + count + 1] = points[1];
|
|
count += verticesStride;
|
|
vertices[verticesOffset + count] = points[2];
|
|
vertices[verticesOffset + count + 1] = points[3];
|
|
count += verticesStride;
|
|
vertices[verticesOffset + count] = points[6];
|
|
vertices[verticesOffset + count + 1] = points[7];
|
|
count += verticesStride;
|
|
vertices[verticesOffset + count] = points[4];
|
|
vertices[verticesOffset + count + 1] = points[5];
|
|
points = verticesOffset / verticesStride;
|
|
indices[indicesOffset++] = points;
|
|
indices[indicesOffset++] = points + 1;
|
|
indices[indicesOffset++] = points + 2;
|
|
indices[indicesOffset++] = points + 1;
|
|
indices[indicesOffset++] = points + 3;
|
|
indices[indicesOffset++] = points + 2;
|
|
}};
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$graphics$shared$buildCommands$buildRectangle.js.map
|