MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXNTC / SetDisplayScaleStable

Method SetDisplayScaleStable

tools/explorer/FlatImageView.cpp:253–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253void FlatImageView::SetDisplayScaleStable(float newScale, dm::int2 stablePoint)
254{
255 const float2 stableUv = WindowPosToUv(stablePoint);
256 const float2 splitUv = WindowPosToUv(int2(m_splitPosition, 0));
257
258 m_displayScale = newScale;
259
260 // Move the center using the difference between where the mouse cursor actually is
261 // and where it is predicted to be using the new scale
262 m_textureCenterOffset += stablePoint - UvToWindowPos(stableUv);
263
264 // Move the split to maintain its position relative to the image
265 m_splitPosition = UvToWindowPos(splitUv).x;
266}
267
268bool FlatImageView::MouseScrollUpdate(double xoffset, double yoffset)
269{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected