Grid and Table API Unification [More Flexible Tables Pt.1] #3009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2616
First task in #3001.
Implements all missing table parameters in grid, namely
align
,inset
,fill
andstroke
.Added tests.
Implementation details
align
andinset
are handled by Grid and Table themselves through theapply_align_inset_to_cells
function.fill
andstroke
are handled inside GridLayouter, on.layout()
(which calls.render_fills_strokes()
).TableElem
's code.table.cell
andgrid.cell
are implemented in a future PR.Possible improvements
impl Layout
code to a function likelayout_grid
, since it's the same, but I figured that this is already more or less GridLayouter's job anyway - but I still felt likealign
andinset
, at least for now, could be handled outside of it. So, at the moment, there is a bit of duplication, but maybe it's not that bad? I can make somelayout_grid
function either way if that's better.