[Bf-blender-cvs] [be983295ea1] blender2.8: Fix: Moving area edge could corrupt screen in very specific case

Severin noreply at git.blender.org
Fri Jun 29 02:27:31 CEST 2018


Commit: be983295ea14af226b3c824a035ccee9d416c67f
Author: Severin
Date:   Fri Jun 29 02:04:46 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBbe983295ea14af226b3c824a035ccee9d416c67f

Fix: Moving area edge could corrupt screen in very specific case

Caused by ca8f787349dcdf5. This issue is in master actually. Fixing it there
would cause conflicts so won't do that unless needed ;)

Steps to recreate were:
* Split properties editor into two (default startup.blend)
* Move both properties editors to the bottom, so only their headers are visible
* Move the upper edge of the upper properties editor up and down
Although it doesn't happen everytime, you may see the edge between the timeline
and the 3D view move, while the region drawing doesn't update.

What happened is area edge snapping allowed to snap the edge outside of window
bounds (we snap to a 4px grid by default), which screen_vertices_scale
interpreted as window scaling and thus run area size updates.

===================================================================

M	source/blender/editors/screen/screen_ops.c

===================================================================

diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 8a7af5b39c2..6aad4e98ab6 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -1366,6 +1366,7 @@ static int area_snap_calc_location(
 			final_loc = m_loc;
 			if (delta != bigger && delta != -smaller) {
 				final_loc -= (m_loc % AREAGRID);
+				CLAMP(final_loc, origval - smaller, origval + bigger);
 			}
 			break;
 
@@ -1428,10 +1429,10 @@ static void area_move_apply_do(
 {
 	wmWindow *win = CTX_wm_window(C);
 	bScreen *sc = CTX_wm_screen(C);
+	short final_loc = -1;
 	bool doredraw = false;
-	CLAMP(delta, -smaller, bigger);
 
-	short final_loc = -1;
+	CLAMP(delta, -smaller, bigger);
 
 	if (snap_type == SNAP_NONE) {
 		final_loc = origval + delta;



More information about the Bf-blender-cvs mailing list