Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect if we're in the bar, and do a little variable renaming to be s…
…afe.
- Loading branch information
Showing
6 changed files
with
60 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
"""Constants and other similar configuration.""" | ||
|
||
WIDTH = 1024 | ||
HEIGHT = 768 | ||
HEIGHT = 768 | ||
BARSIZE=200 | ||
BARLOC="top" | ||
|
||
def is_in_bar(x, y): | ||
if BARLOC=="top": | ||
return (y>HEIGHT-BARSIZE and y<HEIGHT) | ||
elif BARLOC=="bottom": | ||
return (y>0 and y<BARSIZE) | ||
elif BARLOC=="right": | ||
return (x>WIDTH-BARSIZE and x<WIDTH) | ||
elif BARLOC=="left": | ||
return (x>0 and x<BARSIZE) | ||
else: | ||
raise Exception("invalid bar location specified in config") |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters