diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2016-11-17 21:20:55 +0100 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2016-11-17 21:21:08 +0100 |
commit | 7f25c0120fc7bc6a6eeee87878cf387647d51614 (patch) | |
tree | ab510060a2c5625d00e7f19f4c7d699861b98cea /grc/gui/Utils.py | |
parent | e1acf2d27760d606cc7cba200aa380e885f2ffaf (diff) | |
parent | 1d50d70f0b990b909357a803881955623dea94d8 (diff) |
Merge remote-tracking branch 'upstream/next' into gtk3
Diffstat (limited to 'grc/gui/Utils.py')
-rw-r--r-- | grc/gui/Utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/grc/gui/Utils.py b/grc/gui/Utils.py index 782a7e3a01..38fde80465 100644 --- a/grc/gui/Utils.py +++ b/grc/gui/Utils.py @@ -143,3 +143,13 @@ def make_screenshot(flow_graph, file_path, transparent_bg=False): if file_path.endswith('.pdf') or file_path.endswith('.svg'): cr.show_page() psurf.finish() + + +def scale(coor, reverse=False): + factor = Constants.DPI_SCALING if not reverse else 1 / Constants.DPI_SCALING + return tuple(int(x * factor) for x in coor) + + +def scale_scalar(coor, reverse=False): + factor = Constants.DPI_SCALING if not reverse else 1 / Constants.DPI_SCALING + return int(coor * factor) |