Capture window resize

I would like to observe changes of the viewport size:

genericRenderWindow.onResize(this.onRenderWindowResized) as vtkSubscription; onRenderWindowResized(obj: vtkObject) { console.log(obj); }

Why is the output always undefined? What am I missing here?

Because that method is called without any argument.

That’s understood, thank you. However, doesn’t this line imply that the callback is passed instance: vtkObject as an argument?

Yes, the typescript definition is wrong. Unless we want to fix the code to match the TS definition.

1 Like