Reduce computing by skipping the most 'getContains' calls without notable effect

This commit is contained in:
abakkk 2020-06-19 01:18:16 +02:00
parent 5ca7a5e4a6
commit 6f9b07b64d
1 changed files with 4 additions and 0 deletions

View File

@ -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)