Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2013-09-05 17:03:03 +0400
committerTon Roosendaal <ton@blender.org>2013-09-05 17:03:03 +0400
commitdc8832ac92b3640f7dcb784086417da925c9e721 (patch)
tree439fc0393e8b2bbfefdb840e64264739df653297 /release/scripts/startup/bl_operators/node.py
parent69b68ed867407538a9b231cabf3481cb1404b37f (diff)
Bugfix #35920
Adding a new node in Node Editor failed for "High DPI" (Only Mac retina now). - Py script for adding nodes was doing dpi magic, which it shouldn't. It has been replaced with a (temporary) API call to set the correct cursor location. (Thanks to Lukas T for helping here) - The SpaceNode->cursor[2] property now is *only* storing the coordinate in "adding new node space". Use of this has been removed from the code where possible, with as only exception the code to draw noodles while adding them. Special coder note: Nodes should respect the DPI value, and draw larger with larger buttons if you increase this size. The hack here is that this can only work nice if also the node positions are scaled accordingly. A better fix could be to check on scaling the node view itself for it. That then would also remove this Python API call that was added in this commit. However, that again might fight with how buttons layout code works now... needs some careful checking.
Diffstat (limited to 'release/scripts/startup/bl_operators/node.py')
-rw-r--r--release/scripts/startup/bl_operators/node.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py
index c70b5832bfb..16349c27e39 100644
--- a/release/scripts/startup/bl_operators/node.py
+++ b/release/scripts/startup/bl_operators/node.py
@@ -66,12 +66,8 @@ class NodeAddOperator():
# convert mouse position to the View2D for later node placement
if context.region.type == 'WINDOW':
- # XXX, temp fix for [#35920], still fails for (U.pixelsize != 1)
- dpi_fac = context.user_preferences.system.dpi / 72.0
- space.cursor_location = v2d.region_to_view(event.mouse_region_x,
- event.mouse_region_y)
- space.cursor_location /= dpi_fac
-
+ # convert mouse position to the View2D for later node placement
+ space.cursor_location_from_region(event.mouse_region_x, event.mouse_region_y)
else:
space.cursor_location = tree.view_center