diff --git a/Sources/Rendering/Core/Coordinate/index.js b/Sources/Rendering/Core/Coordinate/index.js index 5a228fd2fd8..6360c4b55ae 100644 --- a/Sources/Rendering/Core/Coordinate/index.js +++ b/Sources/Rendering/Core/Coordinate/index.js @@ -428,7 +428,12 @@ function vtkCoordinate(publicAPI, model) { val = renderer.viewToProjection(val[0], val[1], val[2], aspect); val = renderer.projectionToNormalizedViewport(val[0], val[1], val[2]); - val = view.normalizedViewportToViewport(val[0], val[1], val[2]); + val = view.normalizedViewportToViewport( + val[0], + val[1], + val[2], + renderer + ); val = view.viewportToNormalizedDisplay( val[0], val[1], @@ -441,7 +446,12 @@ function vtkCoordinate(publicAPI, model) { case Coordinate.VIEW: { val = renderer.viewToProjection(val[0], val[1], val[2], aspect); val = renderer.projectionToNormalizedViewport(val[0], val[1], val[2]); - val = view.normalizedViewportToViewport(val[0], val[1], val[2]); + val = view.normalizedViewportToViewport( + val[0], + val[1], + val[2], + renderer + ); val = view.viewportToNormalizedDisplay( val[0], val[1], @@ -453,7 +463,12 @@ function vtkCoordinate(publicAPI, model) { } case Coordinate.PROJECTION: { val = renderer.projectionToNormalizedViewport(val[0], val[1], val[2]); - val = view.normalizedViewportToViewport(val[0], val[1], val[2]); + val = view.normalizedViewportToViewport( + val[0], + val[1], + val[2], + renderer + ); val = view.viewportToNormalizedDisplay( val[0], val[1], @@ -464,7 +479,12 @@ function vtkCoordinate(publicAPI, model) { break; } case Coordinate.NORMALIZED_VIEWPORT: { - val = view.normalizedViewportToViewport(val[0], val[1], val[2]); + val = view.normalizedViewportToViewport( + val[0], + val[1], + val[2], + renderer + ); if (model.referenceCoordinate) { const refValue = model.referenceCoordinate.getComputedDoubleViewportValue( diff --git a/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js b/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js index 27ed4618f0b..c6eb66a9e85 100644 --- a/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js +++ b/Sources/Rendering/SceneGraph/RenderWindowViewNode/index.js @@ -117,8 +117,8 @@ function vtkRenderWindowViewNode(publicAPI, model) { return [x, y, z]; }; - publicAPI.normalizedViewportToViewport = (x, y, z) => { - const size = publicAPI.getFramebufferSize(); + publicAPI.normalizedViewportToViewport = (x, y, z, renderer) => { + const size = publicAPI.getViewportSize(renderer); return [x * (size[0] - 1.0), y * (size[1] - 1.0), z]; };