Page MenuHome

Fix T100772: Joins with Interfering Tiny Areas
ClosedPublic

Authored by Harley Acheson (harley) on Nov 15 2022, 9:41 PM.

Details

Summary

Detect unlikely situation of an area (that is smaller than our allowed
minimums) sharing an edge that will be moved during a join.


Complex area joining makes some assumptions in order to work as it does. It assumes that if the misalignment of the areas is GREATER than our minimum area sizes then they can be split and the results will be areas of valid size. Further, if the misalignment is LESS than our minimum sizes then the two can be aligned by having their screen edges moved.

However, there is a scenario that can cause invalid regions in the latter case. There could be a separate area, that is SMALLER than our minimums, that shares an edge that will be moved. Having areas that are smaller than our minimums is unlikely, but not impossible. One way to create them has been fixed in {d26a0be968e0}, but it is not possible to entirely eliminate the possibility. Simply enlarge a window over multiple monitors, resize one area to minimum, then scale the window back down and that area will now be too small.

In the following example, you can see a tiny area between 3DView and Properties. This would interfere with (only) a join between 3DView and the Timeline below it, because of how their right-side edges would be moved. There would not a problem is that area were minimum width.

This patch adds screen_areas_can_align that tests for the conditions that would make an alignment or workspace fail, and includes tests for this (odd) case.

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Nov 15 2022, 9:41 PM
Harley Acheson (harley) created this revision.
Harley Acheson (harley) edited the summary of this revision. (Show Details)
Harley Acheson (harley) edited the summary of this revision. (Show Details)Nov 15 2022, 9:53 PM

Accepting with minor requests.

source/blender/editors/screen/screen_edit.c
365

*picky* (AREAJOINTOLERANCEY, AREAJOINTOLERANCEX) can be assigned to const vars & reused, as this multiplies by U.dpi_fac.

382–383

*picky* - can be const.

393–394

*picky* - can be const.

453

Comment needs finishing.

454

*picky* clang-format.

This revision is now accepted and ready to land.Nov 16 2022, 6:11 AM
Harley Acheson (harley) marked 5 inline comments as done.

Updated to incorporate all changes suggested by review.