Skip to content

Commit

Permalink
BUG #1740: plotting with bg=0 produces labels off
Browse files Browse the repository at this point in the history
This also fixes BUG #78 in cdat-web.
For both bugs, VTKPlots.configureEvent is not called to reposition the labels.
  • Loading branch information
danlipsa committed Mar 1, 2016
1 parent 39a367c commit b469495
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Packages/vcs/Lib/VTKPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand All @@ -357,7 +358,7 @@ def createRenderer(self, *args, **kargs):
return ren

def update(self, *args, **kargs):
self._lastSize = -1
self._lastSize = None
if self.renWin:
if self.get3DPlot():
plots_args = []
Expand Down Expand Up @@ -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
self.canvas.bgX = width
self.canvas.bgY = height
self.renWin.SetSize(width, height)
self.configureEvent(None, None)
else:
user_dims = None
Expand Down
5 changes: 5 additions & 0 deletions testing/vcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,11 @@ cdat_add_test(vcs_test_meshfill_zoom_flip
"${BASELINE_DIR}/vcs_test_meshfill_zoom_flip.png"
flip
)
cdat_add_test(vcs_test_isofill_labels_off.png
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/vcs_test_isofill_labels_off.py
"${BASELINE_DIR}/vcs_test_isofill_labels_off.png"
)
cdat_add_test(vcs_test_meshfill_zoom_flip
"${PYTHON_EXECUTABLE}"
${cdat_SOURCE_DIR}/testing/vcs/vcs_test_meshfill_zoom.py
Expand Down

0 comments on commit b469495

Please sign in to comment.