Skip to content

Commit

Permalink
[skip ci] enforce code format
Browse files Browse the repository at this point in the history
  • Loading branch information
taichi-gardener committed Sep 9, 2020
1 parent d89f297 commit cf8b55c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions taichi/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -823,14 +823,16 @@ class GUI : public GUIBase {
}
last_frame_time = this_frame_time;
// Some old examples / users don't even provide a `break` statement for us
// to terminate loop. So we have to terminate the program with RuntimeError
// if ti.GUI.EXIT event is not processed. Pretty like SIGTERM, you can hook
// it, but you have to terminate after your handler is done.
// to terminate loop. So we have to terminate the program with
// RuntimeError if ti.GUI.EXIT event is not processed. Pretty like
// SIGTERM, you can hook it, but you have to terminate after your handler
// is done.
if (should_close) {
if (++should_close > 5) {
// if the event is not processed in 5 frames, raise RuntimeError
throw std::string(
"Window close button clicked, exiting... (use `while gui.running` "
"Window close button clicked, exiting... (use `while "
"gui.running` "
"to exit gracefully)");
}
}
Expand All @@ -848,7 +850,6 @@ class GUI : public GUIBase {
}
}


bool has_key_event() {
return !!key_events.size();
}
Expand Down

0 comments on commit cf8b55c

Please sign in to comment.