[latex3-commits] [git/LaTeX3-latex3-latex3] master: Add scope surrounding PDF graphics (4860a074f)
Joseph Wright
joseph.wright at morningstar2.co.uk
Tue Feb 23 17:48:45 CET 2021
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/4860a074f9521b24c5f39a39f7de9196cfc0b7f5
>---------------------------------------------------------------
commit 4860a074f9521b24c5f39a39f7de9196cfc0b7f5
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Feb 23 16:48:45 2021 +0000
Add scope surrounding PDF graphics
>---------------------------------------------------------------
4860a074f9521b24c5f39a39f7de9196cfc0b7f5
l3backend/CHANGELOG.md | 3 +++
l3backend/l3backend-graphics.dtx | 10 ++++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/l3backend/CHANGELOG.md b/l3backend/CHANGELOG.md
index f787acd70..d7395455c 100644
--- a/l3backend/CHANGELOG.md
+++ b/l3backend/CHANGELOG.md
@@ -6,6 +6,9 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Changed
+- Add scope surrounding PDF graphics
+
## [2021-02-18]
### Changed
diff --git a/l3backend/l3backend-graphics.dtx b/l3backend/l3backend-graphics.dtx
index c3ec121c0..fb957eef5 100644
--- a/l3backend/l3backend-graphics.dtx
+++ b/l3backend/l3backend-graphics.dtx
@@ -164,7 +164,9 @@
% Measuring the graphic is done by boxing up: for PDF graphics we could
% use |\tex_pdfximagebbox:D|, but if doesn't work for other types.
% As the box always starts at $(0,0)$ there is no need to worry about
-% the lower-left position.
+% the lower-left position. The scope in the internal box here means that
+% thre is no leakage of any graphics stage information at point-of-use from
+% the image to the rest of the document.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_getbb_auxii:n #1
{
@@ -187,7 +189,11 @@
{ \l_graphics_pagebox_tl }
{#1}
\hbox_set:Nn \l_@@_internal_box
- { \tex_pdfrefximage:D \tex_pdflastximage:D }
+ {
+ \__kernel_backend_scope_begin:
+ \tex_pdfrefximage:D \tex_pdflastximage:D
+ \__kernel_backend_scope_end:
+ }
\dim_set:Nn \l_graphics_urx_dim { \box_wd:N \l_@@_internal_box }
\dim_set:Nn \l_graphics_ury_dim { \box_ht:N \l_@@_internal_box }
\int_const:cn { c_@@_graphics_ #1 \l_@@_graphics_attr_tl _int }
More information about the latex3-commits
mailing list.