-
Notifications
You must be signed in to change notification settings - Fork 68
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
BUG #1740: plotting with bg=0 produces labels off #1862
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -344,6 +344,7 @@ def createRenWin(self, *args, **kargs): | |
if not self.bg: | ||
self.createDefaultInteractor(self.renderer) | ||
self.renWin.AddRenderer(self.renderer) | ||
self.renWin.AddObserver("ModifiedEvent", self.configureEvent) | ||
if self.bg: | ||
self.renWin.SetOffScreenRendering(True) | ||
if "open" in kargs and kargs["open"]: | ||
|
@@ -357,7 +358,7 @@ def createRenderer(self, *args, **kargs): | |
return ren | ||
|
||
def update(self, *args, **kargs): | ||
self._lastSize = -1 | ||
self._lastSize = None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @danlipsa have you tested on mac? Mac is VERY different about this, also we need to test within GUI. @chaosphere2112 can you please test on your mac and in your new GUI? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @doutriaux1 No, I haven't. I have my mac with me and I can run the tests. I tried to be very conservative in what I change. :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chaosphere2112 I added a missing png for a test you added. Can you make sure it is the correct image? Thanks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @doutriaux1 There are a bunch of test failures because of small differences in the baselines - that happens on master branch as well. I will push _xx versions shortly. Everything else looks good. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chaosphere2112 For test_vcs_missing_colorname I get 'Cell index must be in the range 0 to 255'. I'll let you fix that. That happens only on mac, on linux it works fine. |
||
if self.renWin: | ||
if self.get3DPlot(): | ||
plots_args = [] | ||
|
@@ -1076,9 +1077,11 @@ def png(self, file, width=None, height=None, | |
if width is not None and height is not None: | ||
if self.renWin.GetSize() != (width, height): | ||
user_dims = (self.canvas.bgX, self.canvas.bgY, sz[0], sz[1]) | ||
self.renWin.SetSize(width, height) | ||
# We need to set canvas.bgX and canvas.bgY before we do renWin.SetSize | ||
# otherwise, canvas.bgX,canvas.bgY will win | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @danlipsa what do you mean by canvas.bgX,canvas.bgY will win? if you set it after they should be un-used right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aashish24 In the original order, SetSize triggered code that reset the size to bgX, bgY. Not sure which test has shown this. It is easy to investigate if we want to. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
if that's the case why not just call SetSize and not set bgX and bgY There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I belive bgX and bgY is only used when bg=1? @doutriaux1 @danlipsa if yes, that would explain why it would fail in bg=1 and not in bg=0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because you will endup, in certain cases, with bgX, bgY, not with the parameters you pass in SetSize There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
if SetSize triggers something which set bgX and bgY in some cases which won't be same as the origin args then I think we have problem. I think its worth looking into it. Thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No, this SetSize triggers code that, in certain cases, sets the size of the window to bgX, bgY rather than the parameters passed to SetSize. The test that fails with the order reversed is vcs_test_png_set_size. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aashish24 This is the stack trace that explains why this happens: |
||
self.canvas.bgX = width | ||
self.canvas.bgY = height | ||
self.renWin.SetSize(width, height) | ||
self.configureEvent(None, None) | ||
else: | ||
user_dims = None | ||
|
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 looks good to me.