fix for minor error in previous commit (wasnt connecting right faces for cyclic mask), also avoid doing more area calculations then needed when checking if the mouse is moving away from uiBlock.
This commit is contained in:
@@ -760,16 +760,16 @@ void BLI_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas
|
||||
}
|
||||
|
||||
if (open_spline_ranges[open_spline_index].is_cyclic) {
|
||||
*(face++) = start_vidx + 3; /* next span */ /* z 1 */
|
||||
*(face++) = start_vidx + 0; /* next span */ /* z 1 */
|
||||
*(face++) = j + 0; /* z 1 */
|
||||
*(face++) = j + 1; /* z 0 */
|
||||
*(face++) = start_vidx + 4; /* next span */ /* z 0 */
|
||||
*(face++) = start_vidx + 1; /* next span */ /* z 0 */
|
||||
|
||||
face_index++;
|
||||
|
||||
*(face++) = j + 0; /* z 1 */
|
||||
*(face++) = start_vidx + 3; /* next span */ /* z 1 */
|
||||
*(face++) = start_vidx + 5; /* next span */ /* z 0 */
|
||||
*(face++) = start_vidx + 0; /* next span */ /* z 1 */
|
||||
*(face++) = start_vidx + 2; /* next span */ /* z 0 */
|
||||
*(face++) = j + 2; /* z 0 */
|
||||
|
||||
face_index++;
|
||||
|
||||
@@ -5937,14 +5937,13 @@ static int ui_mouse_motion_towards_check(uiBlock *block, uiPopupBlockHandle *men
|
||||
newp[0] = mx;
|
||||
newp[1] = my;
|
||||
|
||||
if (len_v2v2(oldp, newp) < 4.0f)
|
||||
if (len_squared_v2v2(oldp, newp) < (4.0f * 4.0f))
|
||||
return menu->dotowards;
|
||||
|
||||
closer = 0;
|
||||
closer |= isect_point_tri_v2(newp, oldp, p1, p2);
|
||||
closer |= isect_point_tri_v2(newp, oldp, p2, p3);
|
||||
closer |= isect_point_tri_v2(newp, oldp, p3, p4);
|
||||
closer |= isect_point_tri_v2(newp, oldp, p4, p1);
|
||||
closer = (isect_point_tri_v2(newp, oldp, p1, p2) ||
|
||||
isect_point_tri_v2(newp, oldp, p2, p3) ||
|
||||
isect_point_tri_v2(newp, oldp, p3, p4) ||
|
||||
isect_point_tri_v2(newp, oldp, p4, p1));
|
||||
|
||||
if (!closer)
|
||||
menu->dotowards = 0;
|
||||
|
||||
Reference in New Issue
Block a user