mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Move line scroll multiplier to constants.js
This commit is contained in:
parent
eb751cb91e
commit
ce4204c2f2
2 changed files with 11 additions and 11 deletions
|
@ -72,6 +72,16 @@ Blockly.COLLAPSE_CHARS = 30;
|
|||
*/
|
||||
Blockly.LONGPRESS = 750;
|
||||
|
||||
/**
|
||||
* Distance to scroll when a mouse wheel event is received and its delta mode
|
||||
* is line (0x1) instead of pixel (0x0). In these cases, a single "scroll" has
|
||||
* a delta of 1, which makes the workspace scroll very slowly (just one pixel).
|
||||
* To compensate, that delta is multiplied by this value.
|
||||
* @const
|
||||
* @package
|
||||
*/
|
||||
Blockly.LINE_SCROLL_MULTIPLIER = 15;
|
||||
|
||||
/**
|
||||
* Prevent a sound from playing if another sound preceded it within this many
|
||||
* milliseconds.
|
||||
|
|
|
@ -193,16 +193,6 @@ Blockly.WorkspaceSvg.prototype.startScrollY = 0;
|
|||
*/
|
||||
Blockly.WorkspaceSvg.prototype.dragDeltaXY_ = null;
|
||||
|
||||
/***
|
||||
* Distance to scroll when a mouse wheel event is received and
|
||||
* its delta mode is line (0x1) instead of pixel (0x0). In these
|
||||
* cases, a single "scroll" has a delta of 1, which makes the
|
||||
* workspace scroll very slowly (just one pixel). To compensate,
|
||||
* that delta is multiplied by this value.
|
||||
* @type {number}
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.lineScrollMultiplier = 15;
|
||||
|
||||
/**
|
||||
* Current scale.
|
||||
* @type {number}
|
||||
|
@ -1311,7 +1301,7 @@ Blockly.WorkspaceSvg.prototype.onMouseWheel_ = function(e) {
|
|||
|
||||
// Multiplier variable, so that non-pixel-deltaModes are supported.
|
||||
// See LLK/scratch-blocks#1190.
|
||||
var multiplier = e.deltaMode === 0x1 ? this.lineScrollMultiplier : 1;
|
||||
var multiplier = e.deltaMode === 0x1 ? Blockly.LINE_SCROLL_MULTIPLIER : 1;
|
||||
|
||||
if (e.ctrlKey) {
|
||||
// The vertical scroll distance that corresponds to a click of a zoom button.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue