Skip to content

Make Zoom center on Workspace and not Blockly #775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

TheBrokenRail
Copy link
Contributor

Resolves

Part of #43

Proposed Changes

Make Zoom center on Workspace and not Blockly

Reason for Changes

So zoom does not look offset

Test Coverage

Please show how you have added tests to cover your changes

@@ -1348,6 +1348,15 @@ Blockly.WorkspaceSvg.prototype.zoomCenter = function(type) {
var metrics = this.getMetrics();
var x = metrics.viewWidth / 2;
var y = metrics.viewHeight / 2;
if (this.options.toolboxPosition == 2) {

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

rachel-fenichel added a commit to rachel-fenichel/scratch-blocks that referenced this pull request Feb 15, 2017
…/generator_docstrings

Update generator comments
@@ -1348,6 +1348,13 @@ Blockly.WorkspaceSvg.prototype.zoomCenter = function(type) {
var metrics = this.getMetrics();
var x = metrics.viewWidth / 2;
var y = metrics.viewHeight / 2;
if (this.options.toolboxPosition == Blockly.TOOLBOX_AT_LEFT) {
x = x + 250;
} else if (this.options.toolboxPosition == Blockly.TOOLBOX_AT_RIHT) {

This comment was marked as abuse.

This comment was marked as abuse.

@thisandagain
Copy link
Contributor

This is still using magic numbers to perform the offset. Closing until we have time to come up with an alternative approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants