From 6f9b07b64d8e36be5fa04e2e7f4112ae341d0702 Mon Sep 17 00:00:00 2001 From: abakkk Date: Fri, 19 Jun 2020 01:18:16 +0200 Subject: [PATCH] Reduce computing by skipping the most 'getContains' calls without notable effect --- draw.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/draw.js b/draw.js index 29b86e7..17419ec 100644 --- a/draw.js +++ b/draw.js @@ -424,6 +424,10 @@ var DrawingArea = new Lang.Class({ return; } + // Reduce computing without notable effect. + if (Math.random() <= 0.75) + return; + let coords = event.get_coords(); let [s, x, y] = this.transform_stage_point(coords[0], coords[1]); if (!s)