[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30515] trunk/blender/source/blender/ editors/space_node/node_state.c: Fix #22911
Diego Borghetti
bdiego at gmail.com
Tue Jul 20 00:47:15 CEST 2010
Revision: 30515
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30515
Author: bdiego
Date: 2010-07-20 00:47:15 +0200 (Tue, 20 Jul 2010)
Log Message:
-----------
Fix #22911
[#22911] Node editors: pressing home doesn't zoom properly
Was using the incorrect value to calculate the new area
(also a typo in the ymax/xmax).
The bug can be found on the 2.4x version too, not really
sure how old is it.
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_node/node_state.c
Modified: trunk/blender/source/blender/editors/space_node/node_state.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_state.c 2010-07-19 22:46:34 UTC (rev 30514)
+++ trunk/blender/source/blender/editors/space_node/node_state.c 2010-07-19 22:47:15 UTC (rev 30515)
@@ -243,7 +243,7 @@
cur->xmin= cur->ymin= 0.0f;
cur->xmax=ar->winx;
- cur->xmax= ar->winy;
+ cur->ymax=ar->winy;
if(snode->edittree) {
for(node= snode->edittree->nodes.first; node; node= node->next) {
@@ -261,19 +261,20 @@
snode->yof= 0;
width= cur->xmax - cur->xmin;
height= cur->ymax- cur->ymin;
+
if(width > height) {
float newheight;
newheight= oldheight * width/oldwidth;
cur->ymin= cur->ymin - newheight/4;
- cur->ymax= cur->ymin + newheight;
+ cur->ymax= cur->ymax + newheight/4;
}
else {
float newwidth;
newwidth= oldwidth * height/oldheight;
cur->xmin= cur->xmin - newwidth/4;
- cur->xmax= cur->xmin + newwidth;
+ cur->xmax= cur->xmax + newwidth/4;
}
-
+
ar->v2d.tot= ar->v2d.cur;
UI_view2d_curRect_validate(&ar->v2d);
}
More information about the Bf-blender-cvs
mailing list