Skip to content

Commit

Permalink
Merge pull request #566 from jasperhabicht/main
Browse files Browse the repository at this point in the history
Optimized coordinate and node positioning
  • Loading branch information
lvjr authored Dec 28, 2024
2 parents f50c973 + 67b1c67 commit 6b089be
Showing 1 changed file with 29 additions and 34 deletions.
63 changes: 29 additions & 34 deletions tabularray.sty
Original file line number Diff line number Diff line change
Expand Up @@ -7819,10 +7819,18 @@
\hbox_set:Nn \l__tblr_tikz_node_box
{
\begin{tikzpicture}[remember ~ picture, overlay]
\coordinate
(
tblr \g__tblr_name_str -
\int_use:N \c@rownum - \int_use:N \c@colnum -
single
)
at ( 0pt , -\l__tblr_row_dp_dim ) { } ;
\node
[
tblr / cell ~ node ,
tblr / cell ,
anchor = center ,
text ~ width = \l__tblr_cell_inner_wd_dim ,
text ~ height = \l__tblr_row_ht_dim ,
text ~ depth = \l__tblr_cell_inner_dp_dim
Expand All @@ -7831,26 +7839,19 @@
tblr \g__tblr_name_str -
\int_use:N \c@rownum - \int_use:N \c@colnum
)
at ( 0pt , 0pt ) { } ;
at
(
\l__tblr_cell_hanchor_dim - 0.5 \l__tblr_cell_inner_wd_dim
,
0.5 \l__tblr_row_ht_dim - 0.5 \l__tblr_cell_inner_dp_dim
) { } ;
\end{tikzpicture}
}
\box_set_trim:Nnnnn \l__tblr_tikz_node_box
{
0.5 \l__tblr_cell_inner_wd_dim +
\l__tblr_cell_hanchor_dim
}
{
-0.5 \l__tblr_row_ht_dim +
0.5 \l__tblr_cell_inner_dp_dim
}
{
-0.5 \l__tblr_cell_inner_wd_dim -
\l__tblr_cell_hanchor_dim
}
{
0.5 \l__tblr_row_ht_dim -
0.5 \l__tblr_cell_inner_dp_dim
}
{ 0pt }
{ 0pt }
{ 0pt }
{ 0pt }
\box_use:N \l__tblr_tikz_node_box
\int_compare:nNnT { \c@rownum } = { \c@rowcount }
Expand All @@ -7872,33 +7873,27 @@
[
tblr / table ~ node ,
tblr / table ,
anchor = center ,
text ~ width = \tablewidth ,
text ~ height = \l__tblr_last_cell_table_ht_dim ,
text ~ depth = \l__tblr_last_cell_table_dp_dim
]
(
tblr \g__tblr_name_str - table
)
at ( 0pt , 0pt ) { } ;
at
(
\l__tblr_last_vline_wd_dim - 0.5 \tablewidth
,
0.5 \l__tblr_last_cell_table_ht_dim - 0.5 \l__tblr_last_cell_table_dp_dim
) { } ;
\end{tikzpicture}
}
\box_set_trim:Nnnnn \l__tblr_tikz_node_box
{
0.5 \tablewidth +
\l__tblr_last_vline_wd_dim
}
{
-0.5 \l__tblr_last_cell_table_ht_dim +
0.5 \l__tblr_last_cell_table_dp_dim
}
{
-0.5 \tablewidth -
\l__tblr_last_vline_wd_dim
}
{
0.5 \l__tblr_last_cell_table_ht_dim -
0.5 \l__tblr_last_cell_table_dp_dim
}
{ 0pt }
{ 0pt }
{ 0pt }
{ 0pt }
\box_use:N \l__tblr_tikz_node_box
}
}
Expand Down

0 comments on commit 6b089be

Please sign in to comment.