Skip to content

Conversation

@ecton
Copy link
Member

@ecton ecton commented Nov 30, 2024

Closes #88

  • Grid vertical alignment of cells
  • Add Baseline to VerticalAlign
  • Empty Input widget has a different baseline than when any text is present
  • theme example swatches don't fill the given area

ecton added 10 commits November 30, 2024 09:23
Refs #88

This set of changes starts working towards supporting baseline
alignment. The Grid widget currently does not honor vertical align in
any way, but it in theory propagates the first row's baseline
information -- which will need to be adjusted if Baseline vertical
alignment is used.

Next step is to actually add Baseline and try to make it work. The set
of changes thus far was just so massive and I finally resolved all the
errors from this refactoring.
Also fixed indicator baseline calculations.
The thread sender was limited to 256 pending change callbacks in queue.
A change callback went to enqueue when the channel was full, the
executor thread would deadlock.

Now, the executor thread uses its own queue for enqueuing change
callbacks, ensuring that it cannot be blocked due to too much inbound
traffic.
The containers example has slowed down at some point. Some very basic
benchmarking pointed to the font family list being applied being
expensive. I attempted to reduce the overhead of this by making single
element lists be allocation free. Unfortunately that wasn't enough, and
this slowdown is almost certainly unrelated to this branch, so while I'm
keeping the optimization, the example is still too slow.

In the process of trying to get baseline working for the Grid widget, at
one point I changed the "other" constraint to SizeToFit to prevent
labels from growing. Ultimately, the label code itself was updated to
account for this. By changing this back, many examples were working
correctly again.

Lastly, the selection rectangle for a single line of text wasn't
including the descender... which then became more complex since that
measurement isn't present if the text doesn't have any descenders.
There's an approximation in place now, but I suspect we should measure a
character with a descender to get the line metrics.
ecton added 3 commits March 23, 2025 19:53
This feels hacky, but I'm not sure of a better way to get consistent
measurements.
When not aligning, the child widget should be forced to fill if the
constraint limit is fill.
While updating the changelog I noticed that size now returned a layout,
and it seemed more appropriate to rename the function even though it's a
larger breaking change
@ecton ecton marked this pull request as ready for review March 25, 2025 23:13
@ecton ecton merged commit 329876a into main Mar 25, 2025
5 of 8 checks passed
@ecton ecton deleted the baseline branch March 25, 2025 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Baseline vertical alignment

2 participants