-
Notifications
You must be signed in to change notification settings - Fork 31
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
export_bug_dx_None #257
export_bug_dx_None #257
Conversation
@@ -774,8 +774,8 @@ def get_crop_region(self, panel): | |||
zoom = float(panel['zoom']) | |||
frame_w = panel['width'] | |||
frame_h = panel['height'] | |||
dx = panel['dx'] | |||
dy = panel['dy'] | |||
dx = panel.get('dx', 0) |
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.
since you have code after checking if if dx > 0
(same for dy
) it will be better to introduce a default value default_value= 0
. So if later it changes it is only one place to adjust
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 can't see that we'd ever want a default offset that wasn't zero.
The default for these offsets is really set in the panel_model.js
and it's only rarely (not reproducible) that it's not set here in the script (so we have to catch it just in case).
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.
Why 0 is set in get
, this is "discovered" further down in another check
having a default value makes that clear and explicit
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.
could introduce a variable with value 0 I think it will make the logic clearer
@jburel Added default variable. |
If you could also change |
In that case, we really just need to know if |
understood |
See https://trello.com/c/0TnhjDrs/1-export-bug-dx-none
This fixes a rarely seen bug (not sure how to reproduce it in normal use) in figure export.
Check that figure export still works as expected, with some images zoomed in and panned off-centre. Check cropped region is same in exported figure as in web.