UNPKG

@tsparticles/updater-orbit

Version:

tsParticles particles orbit updater

20 lines (19 loc) 754 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.drawEllipse = drawEllipse; const engine_1 = require("@tsparticles/engine"); const minWidth = 0, half = 0.5, double = 2; function drawEllipse(context, particle, fillColorValue, radius, opacity, width, rotation, start, end) { if (width <= minWidth) { return; } const pos = particle.getPosition(); if (fillColorValue) { context.strokeStyle = (0, engine_1.getStyleFromHsl)(fillColorValue, opacity); } context.lineWidth = width; const rotationRadian = (0, engine_1.degToRad)(rotation); context.beginPath(); context.ellipse(pos.x, pos.y, radius * half, radius * double, rotationRadian, start, end); context.stroke(); }