ID 474293 - Centering the Viewer in build_handles() does not work correctly on high DPI screens

Follow

Problem summary
Centering the Viewer in build_handles() does not work correctly on high DPI screens

 

Customer reported version
Nuke 13.0v1

 

Customer reported platform
N/A

 

Steps to reproduce

NOTE: In order to reproduce this bug, you will need a high dpi display. For example, a Mac with retina display screen.

1) Paste the following code into the class definition of Nuke13.0v1/Documentation/NDKExamples/examplesGrade.cpp


  Op::HandlesMode doAnyHandles(ViewerContext* ctx) override  {    return eHandlesCooked;  }  void build_handles(ViewerContext* ctx) override  {    const auto formatContext = ctx->viewerWindowFormatContext();    // formatCenter may be zero. This causes convertFromViewerToFormat to return inf/nan.    if (formatContext.formatCenter.x != 0.f &&        formatContext.formatCenter.y != 0.f) {      const auto& ca = ctx->clipArea();      const Vector2 viewportCenter(ca.center_x(), ca.center_y());      const Vector2 vfc =          ViewerContext::convertFromViewerToFormat(formatContext, viewportCenter);      ctx->center_viewer(vfc.x, vfc.y);    }  }

2) Build the plugin and launch Nuke.

3) Create a ColorWheel node in the Node Graph.

4) Create a Grade node downstream of the ColorWheel.

5) Connect the Grade node to the Viewer.

6) Press the play button on the Viewer.

7) Due to the following bug, you will need to click and hold the mouse in the Viewer:
ID 473297 - The Track is not stabilized when enabling the center_viewer knob in the Viewer

 

Expected behaviour
Nothing should change, as this code is trying to keep the viewer centered on whatever it already was.

 

Actual behaviour
The image drifts slightly with each frame advance.

 

Workaround
Unknown.

 

Reproduced by support
This bug has been identified by our developers as a regression in Nuke 13.0v1.

    We're sorry to hear that

    Please tell us why