-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
core/workspace_svg.js
Outdated
@@ -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.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
…/generator_docstrings Update generator comments
core/workspace_svg.js
Outdated
@@ -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.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This is still using magic numbers to perform the offset. Closing until we have time to come up with an alternative approach. |
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