mirror of
https://github.com/google/blockly.git
synced 2026-01-10 18:37:09 +01:00
Don't try to zoom flyouts and mutators (#2772)
* Don't try to zoom flyouts and mutators Fixes #2752 Flyouts and mutator workspaces don't have enough info to handle zooming correctly, so they were throwing errors if you pinched them. This adds a check to quit a zoom early if in either of those. We might want to revisit later if we should support zooming on them. * Add TODO
This commit is contained in:
@@ -1690,6 +1690,12 @@ Blockly.WorkspaceSvg.prototype.setBrowserFocus = function() {
|
||||
* amount values zoom in.
|
||||
*/
|
||||
Blockly.WorkspaceSvg.prototype.zoom = function(x, y, amount) {
|
||||
// TODO (#2782): Consider removing once pinch understands zoom configuration
|
||||
// Mutators and flyouts don't support zooming, and pinch doesn't understand
|
||||
// that.
|
||||
if (this.isFlyout || this.isMutator) {
|
||||
return;
|
||||
}
|
||||
// Scale factor.
|
||||
var speed = this.options.zoomOptions.scaleSpeed;
|
||||
var scaleChange = Math.pow(speed, amount);
|
||||
|
||||
Reference in New Issue
Block a user