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

Method MouseButtonUpdate

tools/explorer/FlatImageView.cpp:215–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215bool FlatImageView::MouseButtonUpdate(int button, int action, int mods)
216{
217 if (!m_leftTexture)
218 return false;
219
220 if (action == GLFW_PRESS && button == GLFW_MOUSE_BUTTON_LEFT && mods == 0)
221 {
222 m_drag = true;
223 m_dragStart = m_mousePos;
224 return true;
225 }
226
227 if (action == GLFW_RELEASE && button == GLFW_MOUSE_BUTTON_LEFT && m_drag)
228 {
229 m_drag = false;
230 return true;
231 }
232
233 if (m_displayMode == uint32_t(DisplayMode::SplitScreen))
234 {
235 if (action == GLFW_PRESS && (button == GLFW_MOUSE_BUTTON_LEFT && mods == GLFW_MOD_SHIFT ||
236 button == GLFW_MOUSE_BUTTON_RIGHT && mods == 0))
237 {
238 m_moveSplit = true;
239 m_splitPosition = m_mousePos.x;
240 return true;
241 }
242
243 if (action == GLFW_RELEASE && m_moveSplit)
244 {
245 m_moveSplit = false;
246 return true;
247 }
248 }
249
250 return true;
251}
252
253void FlatImageView::SetDisplayScaleStable(float newScale, dm::int2 stablePoint)
254{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected