Allow command key zoom on mac devices (#5419)

* Allow command key zoom on mac devices

* Clarify comment on mac command key zoom
This commit is contained in:
hpnrep6
2021-09-01 13:16:35 -04:00
committed by GitHub
parent 46fe03cba8
commit e5830283ad

View File

@@ -1800,7 +1800,15 @@ Blockly.WorkspaceSvg.prototype.onMouseWheel_ = function(e) {
}
var scrollDelta = Blockly.utils.getScrollDeltaPixels(e);
if (canWheelZoom && (e.ctrlKey || !canWheelMove)) {
// Zoom should also be enabled by the command key on Mac devices,
// but not super on Unix.
var commandKey;
if (Blockly.utils.userAgent.MAC) {
commandKey = e.metaKey;
}
if (canWheelZoom && (e.ctrlKey || commandKey || !canWheelMove)) {
// Zoom.
// The vertical scroll distance that corresponds to a click of a zoom
// button.