diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-27 10:49:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-27 10:49:23 +0400 |
commit | 29547509b47a4d5c4522e983d574817a78a8ec61 (patch) | |
tree | e3c18b63f727df6035559fdec6dfac9e298f102f /release | |
parent | 821c02ddb77f411499aa48ee00e8858fbc6ade1a (diff) |
fix for adding nodes with a DPI besides 72 causing offset.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/node.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index a28c9bafe49..1e92619c519 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -66,8 +66,12 @@ class NodeAddOperator(): # convert mouse position to the View2D for later node placement if context.region.type == 'WINDOW': + # XXX, why use DPI for coords? + dpi_fac = context.user_preferences.system.dpi / 72.0 space.cursor_location = v2d.region_to_view(event.mouse_region_x, - event.mouse_region_y) + event.mouse_region_y) + space.cursor_location /= dpi_fac + else: space.cursor_location = tree.view_center |