mirror of
https://github.com/google/blockly.git
synced 2026-01-13 03:47:08 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user