Skip to content

Workspace set scale programmatically shifts scrollbar. #3800

@samelhusseini

Description

@samelhusseini

Describe the bug

Setting scale programmatically shifts scrollbars.

To Reproduce

Steps to reproduce the behavior:

  1. Drag a block to the middle of the workspace.
  2. In the console just type:
    const workspace = Blockly.getMainWorkspace();
    workspace.setScale(1); // or any number smaller than or equal to the current workspace scale (workspace.scale)

You'll see that the workspace tend to adjust the blocks to the left side, when you set to a scale greater than the current workspace scale it goes to the position it's supposed to.

Expected behavior

Scrollbars not to shift.

Screenshots

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Stack Traces

Replace with error stack trace.

Additional context

Bug originally surfaced at https://groups.google.com/forum/#!topic/blockly/W5wX_93Eb4g

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugDescribes why the code or behaviour is wrong

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions