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

Caused by ca8f787349. 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.
This commit is contained in:
Severin 2018-06-29 02:04:46 +02:00
parent 4d39da1060
commit be983295ea
Notes: blender-bot 2023-02-14 08:08:56 +01:00
Referenced by issue #55679, Segmentation Fault on start
Referenced by issue #55489, 2.8 crash on startup
1 changed files with 4 additions and 3 deletions

View File

@ -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);
bool doredraw = false;
CLAMP(delta, -smaller, bigger);
short final_loc = -1;
bool doredraw = false;
CLAMP(delta, -smaller, bigger);
if (snap_type == SNAP_NONE) {
final_loc = origval + delta;