-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add zoom in/out/reset and fit option #39
Conversation
@@ -431,6 +431,16 @@ graphs.createGraph = function createGraph (container, options, styles) { | |||
}; | |||
graph.addListener(mxEvent.REFRESH, onRefresh); | |||
|
|||
// * Adds mouse wheel handling for zoom | |||
mxEvent.addMouseWheelListener(function(evt, up) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's up
means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the direction my mouse wheel must move to move the pages' scrollbar up. I think that is the default configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see thanks. Please document that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment explaining up
.
qmxgraph/page/api.js
Outdated
*/ | ||
graphs.Api.prototype.zoomIn = function zoomIn () { | ||
"use strict"; | ||
this._graphEditor.graph.zoomIn(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the underlying API support a parameter that controls how much zoom is applied, like a factor or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a zoomFactor
, but that is graph
member (not an function argument).
I could receive am argument here, use the zoom factor and restore the original value after.
Is that good or you think I should also expose the zoomFactor
member?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I asked just in case the zoomFactor was an argument already.
""" | ||
return self.call_api('fit') | ||
|
||
def get_zoom_scale(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we be able to do any extra work to save the final scene in the project file, with pans, zooms and whatever changes the user made?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went to actually check that since I was expecting it to already be saved on dump
but it is not.
It should be easy since we can obtain all that data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added get_scale_and_translation
/set_scale_and_translation
to abstract the order pan and zoom are applied.
e88f538
to
312eca9
Compare
…on call Having them in a single function call will abstract the order in which the zoom and translations are applied,
Create #41 to check |
No description provided.