Minor cleanup in keyboard nav (#3264)

* Clean cursor code

Some obvious inefficiencies that jumped out while randomly browsing the compiled code.

* Typos

* Multiplying by minus one.
This commit is contained in:
Neil Fraser
2019-10-16 06:19:37 -07:00
committed by alschmiedt
parent 013f2714a3
commit 2eaabd180d
4 changed files with 57 additions and 68 deletions

View File

@@ -96,9 +96,9 @@ Blockly.zelos.ConstantProvider.prototype.makeHexagonal = function() {
var width = height / 2;
var forward = up ? -1 : 1;
var direction = right ? -1 : 1;
return Blockly.utils.svgPaths.lineTo(-1 * direction * width, forward * height / 2) +
Blockly.utils.svgPaths.lineTo(direction * width, forward * height / 2);
var dy = forward * height / 2;
return Blockly.utils.svgPaths.lineTo(-direction * width, dy) +
Blockly.utils.svgPaths.lineTo(direction * width, dy);
}
return {