summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3experimental/l3draw-boxes.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3experimental/l3draw-boxes.dtx')
-rw-r--r--macros/latex/contrib/l3experimental/l3draw-boxes.dtx42
1 files changed, 36 insertions, 6 deletions
diff --git a/macros/latex/contrib/l3experimental/l3draw-boxes.dtx b/macros/latex/contrib/l3experimental/l3draw-boxes.dtx
index 44989999a5..b8f68e90a8 100644
--- a/macros/latex/contrib/l3experimental/l3draw-boxes.dtx
+++ b/macros/latex/contrib/l3experimental/l3draw-boxes.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2023-11-01}
+% \date{Released 2023-12-08}
%
% \maketitle
%
@@ -71,6 +71,8 @@
% \end{variable}
%
% \begin{macro}{\draw_box_use:N}
+% \begin{macro}{\draw_box_use:Nn}
+% \begin{macro}{\@@_box_use:nNnnnnn}
% \begin{macro}{\@@_box_use:Nnnnn}
% Before inserting a box, we need to make sure that the bounding box is being
% updated correctly. As drawings track transformations as a whole, rather
@@ -79,10 +81,22 @@
% \begin{macrocode}
\cs_new_protected:Npn \draw_box_use:N #1
{
- \@@_box_use:Nnnnn #1
+ \@@_box_use:Nnnnnnn #1
{ 0pt } { -\box_dp:N #1 } { \box_wd:N #1 } { \box_ht:N #1 }
}
-\cs_new_protected:Npn \@@_box_use:Nnnnn #1#2#3#4#5
+\cs_new_protected:Npn \draw_box_use:Nn #1#2
+ {
+ \@@_box_use:nNnnnn {#2} #1
+ { 0pt } { -\box_dp:N #1 } { \box_wd:N #1 } { \box_ht:N #1 }
+ }
+\cs_new_protected:Npn \@@_box_use:nNnnnn #1#2#3#4#5#6
+ {
+ \draw_scope_begin:
+ \draw_transform_shift:n {#1}
+ \@@_box_use:Nnnnnnn #2 {#3} {#4} {#5} {#6}
+ \draw_scope_end:
+ }
+\cs_new_protected:Npn \@@_box_use:Nnnnnnn #1#2#3#4#5
{
\bool_if:NT \l_draw_bb_update_bool
{
@@ -126,18 +140,32 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\draw_coffin_use:Nnn}
+% \begin{macro}{\draw_coffin_use:Nnnn}
+% \begin{macro}{\@@_coffin_use:nNnn}
% Slightly more than a shortcut: we have to allow for the fact that coffins
% have no apparent width before the reference point.
% \begin{macrocode}
\cs_new_protected:Npn \draw_coffin_use:Nnn #1#2#3
{
+ \@@_coffin_use:nNnn { \@@_box_use:Nnnnnnn }
+ #1 {#2} {#3}
+ }
+\cs_new_protected:Npn \draw_coffin_use:Nnnn #1#2#3#4
+ {
+ \@@_coffin_use:nNnn { \@@_box_use:nNnnnn {#4} }
+ #1 {#2} {#3}
+ }
+\cs_new_protected:Npn \@@_coffin_use:nNnn #1#2#3#4
+ {
\group_begin:
\hbox_set:Nn \l_@@_tmp_box
- { \coffin_typeset:Nnnnn #1 {#2} {#3} { 0pt } { 0pt } }
- \@@_box_use:Nnnnn \l_@@_tmp_box
- { \box_wd:N \l_@@_tmp_box - \coffin_wd:N #1 }
+ { \coffin_typeset:Nnnnn #2 {#3} {#4} { 0pt } { 0pt } }
+ #1 \l_@@_tmp_box
+ { \box_wd:N \l_@@_tmp_box - \coffin_wd:N #2 }
{ -\box_dp:N \l_@@_tmp_box }
{ \box_wd:N \l_@@_tmp_box }
{ \box_ht:N \l_@@_tmp_box }
@@ -145,6 +173,8 @@
}
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macrocode}
%</package>