From e49834d1e0574348cea3edd4a06d60edf1a67fa0 Mon Sep 17 00:00:00 2001 From: liabru Date: Thu, 8 Apr 2021 00:33:45 +0100 Subject: [PATCH] remove unused render shadow function --- src/render/Render.js | 50 -------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/src/render/Render.js b/src/render/Render.js index fc33c3e0..13152371 100644 --- a/src/render/Render.js +++ b/src/render/Render.js @@ -67,7 +67,6 @@ var Mouse = require('../core/Mouse'); showPositions: false, showAngleIndicator: false, showIds: false, - showShadows: false, showVertexNumbers: false, showConvexHulls: false, showInternalEdges: false, @@ -532,55 +531,6 @@ var Mouse = require('../core/Mouse'); } }; - /** - * Description - * @private - * @method bodyShadows - * @param {render} render - * @param {body[]} bodies - * @param {RenderingContext} context - */ - Render.bodyShadows = function(render, bodies, context) { - var c = context, - engine = render.engine; - - for (var i = 0; i < bodies.length; i++) { - var body = bodies[i]; - - if (!body.render.visible) - continue; - - if (body.circleRadius) { - c.beginPath(); - c.arc(body.position.x, body.position.y, body.circleRadius, 0, 2 * Math.PI); - c.closePath(); - } else { - c.beginPath(); - c.moveTo(body.vertices[0].x, body.vertices[0].y); - for (var j = 1; j < body.vertices.length; j++) { - c.lineTo(body.vertices[j].x, body.vertices[j].y); - } - c.closePath(); - } - - var distanceX = body.position.x - render.options.width * 0.5, - distanceY = body.position.y - render.options.height * 0.2, - distance = Math.abs(distanceX) + Math.abs(distanceY); - - c.shadowColor = 'rgba(0,0,0,0.15)'; - c.shadowOffsetX = 0.05 * distanceX; - c.shadowOffsetY = 0.05 * distanceY; - c.shadowBlur = 1 + 12 * Math.min(1, distance / 1000); - - c.fill(); - - c.shadowColor = null; - c.shadowOffsetX = null; - c.shadowOffsetY = null; - c.shadowBlur = null; - } - }; - /** * Description * @private