summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-28 16:26:52 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-28 16:26:52 +0200
commit024a2e35638436dd36379d86f1619b617c2ecea9 (patch)
treeeb309126e5f498e170196c9ad78f0d7628c00cfd
parent403058ba1e31330689f9b36a10384ee0b2e8ebde (diff)
user-settable vignette
-rw-r--r--gui.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/gui.py b/gui.py
index f4654ef..83730bf 100644
--- a/gui.py
+++ b/gui.py
@@ -33,6 +33,15 @@ marker_updated = [True, True, True]
screensize=(1280, 800)
screen=pygame.display.set_mode(screensize,HWSURFACE|DOUBLEBUF|RESIZABLE)
+vignette = 1.
+
+def enable_vignette(factor=0.15):
+ global vignette
+ if factor:
+ vignette = 1+factor
+ else:
+ vignette = 1
+
def draw_bar(rect, val, thresh=None, min=0, max=1, color=(0,0,0), barcolor=None, exceedcolor=(255,0,0), threshcolor=None):
v = (val-min)/(max-min)
t = (thresh-min)/(max-min)
@@ -160,7 +169,7 @@ def update_zoom():
zoom1 = screensize[0] / calculated_visible_width
zoom2 = screensize[1] / calculated_visible_height
- zoom = min(zoom1,zoom2) / 2
+ zoom = min(zoom1,zoom2) / vignette
def world_to_win_length(l):