From ed88229ebcfac4a3297f2263842e9000eb184870 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 4 Apr 2013 15:10:52 +0000 Subject: Two small fixes: - "Add node" was showing on wrong location when used via pulldown menus. Now this option will put the nodes in center of the view. - The Curves widget was making itself smaller/bigger based on width of region. That messes up the layout engine now - especially the code that checks if there's a scroller needed or not (it went into an eternal feedback loop). Now this widget has fixed height (like the other larger widgets). Better would be to allow such large widgets to be scaled vertically individually. That's for the todo! --- release/scripts/startup/bl_operators/node.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'release/scripts/startup/bl_operators/node.py') diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index c9063436bb3..8f9fa65cf46 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -29,10 +29,14 @@ class NodeAddOperator(): def store_mouse_cursor(context, event): space = context.space_data v2d = context.region.view2d + tree = space.edit_tree # convert mouse position to the View2D for later node placement - space.cursor_location = v2d.region_to_view(event.mouse_region_x, + if context.region.type == 'WINDOW': + space.cursor_location = v2d.region_to_view(event.mouse_region_x, event.mouse_region_y) + else: + space.cursor_location = tree.view_center def create_node(self, context, node_type): space = context.space_data -- cgit v1.2.3