[latex3-commits] [latex3/latex3] object-tracking: Adjust how block/location is calculated (759d25168)
github at latex-project.org
github at latex-project.org
Mon Apr 1 09:18:41 CEST 2024
Repository : https://github.com/latex3/latex3
On branch : object-tracking
Link : https://github.com/latex3/latex3/commit/759d2516833e67368014af992cd3c3a89057e8f9
>---------------------------------------------------------------
commit 759d2516833e67368014af992cd3c3a89057e8f9
Author: Joseph Wright <joseph at texdev.net>
Date: Sun Mar 31 11:49:27 2024 +0100
Adjust how block/location is calculated
>---------------------------------------------------------------
759d2516833e67368014af992cd3c3a89057e8f9
l3kernel/l3pdf.dtx | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/l3kernel/l3pdf.dtx b/l3kernel/l3pdf.dtx
index da9b1de3c..247f31d9a 100644
--- a/l3kernel/l3pdf.dtx
+++ b/l3kernel/l3pdf.dtx
@@ -468,21 +468,30 @@
\exp_args:Ne \@@_backend_object_ref:n
{ \intarray_item:Nn #1 {#2} }
}
+% \end{macrocode}
+% As we want blocks to start from one, and within the block for the top value
+% to be \enquote{in} the block, we do a little bit of manipulation. By shifting
+% down by one, we keep the values \enquote{in} the block, then we adjust the
+% block/index number to get back on track.
+% \begin{macrocode}
\cs_new:Npn \@@_object_indexed_split:nnN #1#2#3
{
\use:e
{
- \exp_not:N #3
+ \exp_not:N #3`
\exp_not:c
{
g_@@_object_ #1 _
\int_eval:n
- { \int_div_truncate:nn {#2} \c_@@_object_block_size_int }
+ {
+ \int_div_truncate:nn { #2 - 1 }
+ \c_@@_object_block_size_int + 1
+ }
_intarray
}
{
\int_eval:n
- { \int_mod:nn {#2} \c_@@_object_block_size_int + 1 }
+ { \int_mod:nn { #2 - 1 } \c_@@_object_block_size_int + 1 }
}
}
}
More information about the latex3-commits
mailing list.