Skip to content

Commit

Permalink
BUG cdat-web #78: VTKPlots.configureEvent is not called
Browse files Browse the repository at this point in the history
A handler for ModifiedEvent is added to the interactor which is replaced
by vtkWeb. A new handler is added on render window.
  • Loading branch information
danlipsa committed Mar 2, 2016
1 parent 39a367c commit 6477076
Showing 1 changed file with 5 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

0 comments on commit 6477076

Please sign in to comment.