Skip to content

Commit

Permalink
Update app.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
wkjarosz committed Dec 26, 2023
1 parent 225cb1e commit c6186e0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,21 +1016,22 @@ bool SampleViewer::process_event(void *e)
case SDL_MOUSEMOTION:
if (sPinch)
return true;
HelloImGui::Log(HelloImGui::LogLevel::Debug, "Got an SDL_MOUSEMOTION event");
// HelloImGui::Log(HelloImGui::LogLevel::Debug, "Got an SDL_MOUSEMOTION event");
break;
// case SDL_MOUSEBUTTONDOWN: HelloImGui::Log(HelloImGui::LogLevel::Debug, "Got an SDL_MOUSEBUTTONDOWN event");
// break; case SDL_MOUSEBUTTONUP: HelloImGui::Log(HelloImGui::LogLevel::Debug, "Got an SDL_MOUSEBUTTONUP
// event"); break; case SDL_FINGERMOTION: HelloImGui::Log(HelloImGui::LogLevel::Debug, "Got an SDL_FINGERMOTION
// event"); break;
case SDL_FINGERDOWN: HelloImGui::Log(HelloImGui::LogLevel::Debug, "Got an SDL_FINGERDOWN event"); break;
// case SDL_FINGERDOWN: HelloImGui::Log(HelloImGui::LogLevel::Debug, "Got an SDL_FINGERDOWN event"); break;
case SDL_MULTIGESTURE:
{
const float cPinchZoomThreshold(0.0001f);
const float cPinchScale(80.0f);
SDL_MultiGestureEvent *m = static_cast<SDL_MultiGestureEvent *>(e);
HelloImGui::Log(
HelloImGui::LogLevel::Debug,
fmt::format("Got an SDL_MULTIGESTURE event; numFingers: {}; dDist: {}", m->numFingers, m->dDist).c_str());
// HelloImGui::Log(
// HelloImGui::LogLevel::Debug,
// fmt::format("Got an SDL_MULTIGESTURE event; numFingers: {}; dDist: {}", m->numFingers,
// m->dDist).c_str());
if (m->numFingers == 2 && fabs(m->dDist) >= cPinchZoomThreshold)
{
sPinch = true;
Expand All @@ -1042,7 +1043,7 @@ bool SampleViewer::process_event(void *e)
}
break;
case SDL_FINGERUP:
HelloImGui::Log(HelloImGui::LogLevel::Debug, "Got an SDL_FINGERUP event");
// HelloImGui::Log(HelloImGui::LogLevel::Debug, "Got an SDL_FINGERUP event");
sPinch = false;
break;
}
Expand Down

0 comments on commit c6186e0

Please sign in to comment.