Skip to content

Commit

Permalink
apply clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightmare82 committed Nov 13, 2023
1 parent e209db0 commit 509feb1
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions imgui-SFML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,12 @@ void ProcessEvent(const sf::Event& event) {
case sf::Event::MouseLeft:
s_currWindowCtx->windowIsHovered = false;
break;
case sf::Event::MouseMoved:
io.AddMousePosEvent(static_cast<float>(event.mouseMove.x),
static_cast<float>(event.mouseMove.y));
case sf::Event::MouseMoved:
io.AddMousePosEvent(static_cast<float>(event.mouseMove.x), static_cast<float>(event.mouseMove.y));
s_currWindowCtx->mouseMoved = true;
break;
default:
break;
default:
break;
}

if (s_currWindowCtx->windowIsHovered) {
Expand All @@ -337,8 +336,7 @@ void ProcessEvent(const sf::Event& event) {
case sf::Event::MouseButtonReleased: {
const int button = event.mouseButton.button;
if (button >= 0 && button < 3) {
if (event.type == sf::Event::MouseButtonPressed)
{
if (event.type == sf::Event::MouseButtonPressed) {
io.AddMouseButtonEvent(button, true);
} else
{
Expand Down Expand Up @@ -440,8 +438,7 @@ void Update(const sf::Vector2i& mousePos, const sf::Vector2f& displaySize, sf::T
io.DisplaySize = ImVec2(displaySize.x, displaySize.y);
io.DeltaTime = dt.asSeconds();

if (s_currWindowCtx->windowIsHovered ||
s_currWindowCtx->windowHasFocus) {
if (s_currWindowCtx->windowIsHovered || s_currWindowCtx->windowHasFocus) {
if (io.WantSetMousePos) {
const sf::Vector2i newMousePos(static_cast<int>(io.MousePos.x),
static_cast<int>(io.MousePos.y));
Expand Down

0 comments on commit 509feb1

Please sign in to comment.