summaryrefslogtreecommitdiff
path: root/grc/gui/Utils.py
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2016-11-17 21:20:55 +0100
committerSebastian Koslowski <koslowski@kit.edu>2016-11-17 21:21:08 +0100
commit7f25c0120fc7bc6a6eeee87878cf387647d51614 (patch)
treeab510060a2c5625d00e7f19f4c7d699861b98cea /grc/gui/Utils.py
parente1acf2d27760d606cc7cba200aa380e885f2ffaf (diff)
parent1d50d70f0b990b909357a803881955623dea94d8 (diff)
Merge remote-tracking branch 'upstream/next' into gtk3
Diffstat (limited to 'grc/gui/Utils.py')
-rw-r--r--grc/gui/Utils.py10
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)