Skip to content

Commit

Permalink
Add braces to single-line ifs.
Browse files Browse the repository at this point in the history
Code review feedback.
  • Loading branch information
rcorre committed Apr 6, 2016
1 parent 0a05828 commit f4d2b24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/controller_base.cpp
Expand Up @@ -151,14 +151,18 @@ bool controller_base::handle_scroll(int mousex, int mousey, int mouse_flags, dou

// scroll if mouse is placed near the edge of the screen
if (mouse_in_window) {
if (mousey < scroll_threshold)
if (mousey < scroll_threshold) {
dy -= scroll_speed;
if (mousey > get_display().h() - scroll_threshold)
}
if (mousey > get_display().h() - scroll_threshold) {
dy += scroll_speed;
if (mousex < scroll_threshold)
}
if (mousex < scroll_threshold) {
dx -= scroll_speed;
if (mousex > get_display().w() - scroll_threshold)
}
if (mousex > get_display().w() - scroll_threshold) {
dx += scroll_speed;
}
}

// scroll with middle-mouse if enabled
Expand Down
3 changes: 2 additions & 1 deletion src/hotkey/command_executor.cpp
Expand Up @@ -578,8 +578,9 @@ void execute_command(const hotkey_command& command, command_executor* executor,
}
}

if (type == HOTKEY_EVENT_RELEASE)
if (type == HOTKEY_EVENT_RELEASE) {
return; // none of the commands here respond to a key release
}

switch (command.id) {

Expand Down

0 comments on commit f4d2b24

Please sign in to comment.