Plot boxed zoom - #1188
Merged
Merged
Plot boxed zoom#1188
Conversation
emilk
requested changes
Jan 31, 2022
emilk
left a comment
Owner
There was a problem hiding this comment.
Nice! Please add instructions for this in the "Instructions" tab in the pot demo. It would also be good to document in the docstring for Plot.
add emlik update on changelog Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
add emlik update on comment in mod.rs Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Contributor
|
This is a great feature! 👍 I wonder, if instead of a enum RegionZoom {
None, // disallow
Rect, // rect/box, like current PR
XRange, // only horizontal, along X axis
YRange, // only vertical, along Y axis
}The X/Y ones are for scaling only along one axis: |
Author
|
@emilk tests are passing my side, I updated with all your comments. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
Very happy to make my first contribution here!
This adds boxed zooming feature on plots.
demo: https://www.youtube.com/watch?v=oUSWUgdFBCs
To allow the feature to work I added:
Plot::allow_boxed_zoom(bool). DefaulttruePlot::boxed_zoom_pointer(PointerButton). Default:SecondaryPlotMemory::last_click_pos_for_zoom: Option<Pos2>, DefaultNoneScreenTransform::bounds_mut(&mut self) -> &mut PlotBoundsAlso changelog has been updated, check.sh is passing. And next time I will make sure to create an issue first.
I had a little non related issue in check.sh so double check for me please.
Regards,