-
Notifications
You must be signed in to change notification settings - Fork 316
Fix savefig size and black image #331
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
7f5c884
call SetSize for the vtkRenderWindow when wx.scene.set_size is called
kitchoi b8694c1
add pillow to travis-requirement
kitchoi 80f13f0
added test for mlab.savefig
kitchoi d7cdb87
use cleanUp to close all figure instead of using contextmanager
kitchoi ac061bc
only the test using Engine + off_screen_rendering fails on master but…
kitchoi ae1f11c
let's only test against the image size and forget about black spots w…
kitchoi 842d052
set_size was doing the right thing, instead it was because the window…
kitchoi 3a3761f
size should be strictly respected. int(target_size // mag) gives wron…
kitchoi 4d85baf
mend
kitchoi c5e2fb3
Revert "mend"
kitchoi bd68dd6
improve comment and function's order
kitchoi b035169
fix lanaguage in the comment [ci skip]
kitchoi a09a1a3
figure should be passed mlab.quiver3d in the test cases
kitchoi 19529f8
calling the resize functions for two IdleEvent causes size to be wron…
kitchoi 2b218a8
modified docstring for savefig
af88c5a
remove OnPaint handler after the scene is closed
kitchoi c00b284
create a new render window for snapshot
0597d50
revert lifting the window for offscreen rendering in wx
44eac58
Merge branch 'fix-savefig-black-image' into fix-savefig-size
233d993
added test for magnification and check for black spot
324d67f
Merge branch 'master' into fix-savefig-size-black-image
kitchoi e3e0c8d
check stereo/off_screen_rendering for older version of VTK
kitchoi 7ce1d5b
read_front_buffer = False
kitchoi af81647
finalize temporary render window
kitchoi 194e89d
use interactor if not on Mac
kitchoi e83050f
force offscreen for the temporary renderwindow for better user experi…
kitchoi e6563e7
safer to use offscreen rendering only when directed
kitchoi 30e6e2b
use interactor to hold the render window when offscreen is true and n…
kitchoi 9b91e6d
clean code
kitchoi fc916f9
whenever render is called, disable_render should be honoured
kitchoi 8996ce2
fix comment
kitchoi 2976e90
changes to read_front_buffer is not needed now
kitchoi 54b7562
Merge branch 'master' into fix-savefig-size-black-image
kitchoi de243bb
Merge branch 'master' into fix-savefig-size-black-image
kitchoi 82ece3a
better ordering of tests
kitchoi f7c6e46
xrange to range
kitchoi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| pillow | ||
| mock | ||
| Sphinx | ||
| coverage | ||
|
|
||
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
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
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.
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.
This one makes me a bit nervous because I checked the rest of the class, and nowhere it is enforced that self._vtk_control is not None. We have the same problem pretty much everywhere. I am generally fine with throwing an exception, but if None is an allowed value, we should react appropriately without throwing. If it's not, it's better to enforce the presence of a control at construction time.
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.
_create_controlis called here https://github.com/enthought/mayavi/blob/fix-savefig-size-black-image/tvtk/pyface/tvtk_scene.py#L205 which assigns_vtk_control. Unlessself._vtk_control = Noneis done somewhere outside of this function (which I have not checked), we can ensure_vtk_controlis not None?Uh oh!
There was an error while loading. Please reload this page.
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.
On other hand, this change is meant to silent error message on Linux + wx 2.8.10 (see message in #346)
The same error does not occur on OSX with wxpython 3.0.2, so I have omitted this change in the reimplementation #346
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.
Good. Merging.