Page MenuHome

Fix T100772: Area AREAMINX on Window Resize
Changes PlannedPublic

Authored by Harley Acheson (harley) on Sep 3 2022, 5:46 PM.

Details

Summary

Constrain areas to minimum width when resizing windows.


When resizing entire windows (by dragging the outer edges) we scale all the areas proportionally while ensuring that the height of areas do not go below a minimum. But we allow areas to become narrower than our minimums:

This patch ensures that areas remain at least our minimum width when resizing this way:

Diff Detail

Repository
rB Blender

Event Timeline

Updated to the current state of master.

Campbell Barton (campbellbarton) requested changes to this revision.EditedSep 22 2022, 8:28 AM

An issue with this patch is it sets the vertices without knowing if the new location overlaps, this can create a corrupt layout.

While I'm not so familier with the logic here, it seems like there would have to be a pass that ensures the new location is legal.

  • There is the minor down-side that shrinking and increasing the scale looses the layout.
  • Changing the DPI could also cause AREAMINX to become invalid too, which this patch doesn't address.

Checking T100772, this patch avoids narrow areas which is OK, but it should do so without causing new problems.


With this patch, the layout becomes corrupt once loaded, and more obviously after making very small, then larger again.


It looks the the join should either not be allowed in the first place (or allow it but don't result in a corrupt layout).

Before the join is accepted it should be possible to check if it would cause an error - the current logic assumes all areas are at least as wide as AREAJOINTOLERANCEY which may not be the case.

This revision now requires changes to proceed.Sep 22 2022, 8:28 AM
Harley Acheson (harley) planned changes to this revision.EditedSep 23 2022, 12:51 AM

@Campbell Barton (campbellbarton) - An issue with this patch is it sets the vertices without knowing if the new location overlaps, this can create a corrupt layout.

This change is just a copy-and-paste of the code above it that constrains the vertical size. Of course they might both be a bit dodgy though.

Changing the DPI could also cause AREAMINX to become invalid too, which this patch doesn't address.

I did address that our AREAMIX isn't always scaled properly in an earlier patch (already committed): D15865: UI: Corrected Scaling of AREAMINX

It looks the the join should either not be allowed in the first place (or allow it but don't result in a corrupt layout).

Yes, my (faulty) assumption is that the alignment of two areas would either be closer than the minimums and I can therefore just move their verts to line them up. Or they are more than the minimum so I can split and create a new area that is at least the minimum. I didn't anticipate this in-between where there might be a sub-minimum area in the way.

I think I'll first make sure that joining won't do damage in this case, probably by not allowing in this case. Then probably double back and take another look at this one.