minor fix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2021-08-20 01:42:20 +03:00
parent 0bb0ddbafc
commit 0ee2e5c33b

View File

@ -1223,6 +1223,9 @@
%% clipped by the containing cell and provides all the cell functionality. %% clipped by the containing cell and provides all the cell functionality.
%% %%
% XXX TODO:
% - offset fix for fill mode...
% - caption cell in fill mode...
% XXX HACK -- need to track down where is this coming from and either % XXX HACK -- need to track down where is this coming from and either
% set it to zero or account for it correctly.... % set it to zero or account for it correctly....
% XXX RENAME -- make this global... % XXX RENAME -- make this global...
@ -1290,24 +1293,25 @@
\def\photobook@imagecell@clearance{#1}}% \def\photobook@imagecell@clearance{#1}}%
% XXX can't seem to get rid of small placement errors... % XXX can't seem to get rid of small placement errors...
% ...feels like we've still got a stray space someplace...
% see: \photobook@HFIX % see: \photobook@HFIX
% XXX can we make this an env??? % XXX can we make this an env???
\newcommand\imagecell[3][]{% \newcommand\imagecell[3][]{%
\begingroup \begingroup%
% args... % args...
\setkeys{imagecell@args}{fit,center,clearance=0pt,#1}% \setkeys{imagecell@args}{fit,center,clearance=0pt,#1}%
% preload image... % preload image...
% fit... % fit...
\ifKV@imagecell@args@fit% \ifKV@imagecell@args@fit%
\sbox{\photobook@imagebox}{% \sbox{\photobook@imagebox}{%
\includegraphics[ \includegraphics[%
keepaspectratio, keepaspectratio,
width=\dimexpr width=\dimexpr
\cellwidth \cellwidth
- ((\photobook@imagecell@clearance) * 2) \relax, - ((\photobook@imagecell@clearance) * 2) \relax,
height=\dimexpr height=\dimexpr
\cellheight \cellheight
- ((\photobook@imagecell@clearance) * 2) \relax, ]{#3}} - ((\photobook@imagecell@clearance) * 2) \relax]{#3}}
% fill... % fill...
\else\ifKV@imagecell@args@fill% \else\ifKV@imagecell@args@fill%
% preload image to get its proportions... % preload image to get its proportions...
@ -1315,23 +1319,22 @@
% constrain minimal dimension of image... % constrain minimal dimension of image...
\ifdim \wd\photobook@imagebox < \ht\photobook@imagebox% \ifdim \wd\photobook@imagebox < \ht\photobook@imagebox%
\sbox{\photobook@imagebox}{% \sbox{\photobook@imagebox}{%
\includegraphics[ \includegraphics[%
keepaspectratio, keepaspectratio,
width=\dimexpr width=\dimexpr
+\cellwidth +\cellwidth
- ((\photobook@imagecell@clearance) * 2) \relax, ]{#3} }% - ((\photobook@imagecell@clearance) * 2) \relax]{#3}}%
\else% \else%
\sbox{\photobook@imagebox}{% \sbox{\photobook@imagebox}{%
\includegraphics[ \includegraphics[%
keepaspectratio, keepaspectratio,
height=\dimexpr height=\dimexpr
+\cellheight +\cellheight
- ((\photobook@imagecell@clearance) * 2) \relax,]{#3} } \fi% - ((\photobook@imagecell@clearance) * 2) \relax]{#3}}\fi\fi\fi%
\fi\fi%
% place image box... % place image box...
% XXX for some odd reason without this the alignment completely breaks... % XXX for some odd reason without this the alignment completely breaks...
\vspace{0pt}% \vspace{0pt}%
\adjustbox{ \adjustbox{%
margin= margin=
{\photobook@imagecell@left - \photobook@HFIX} {\photobook@imagecell@left - \photobook@HFIX}
0pt 0pt 0pt 0pt
@ -1340,7 +1343,9 @@
\usebox\photobook@imagebox% \usebox\photobook@imagebox%
% caption cell... % caption cell...
\ifx #2 \empty \else% \ifx #2 \empty \else%
\begingroup \begingroup%
% XXX broken for fill...
% XXX test for portrait images...
\hspace{-\mindim{% \hspace{-\mindim{%
\wd\photobook@imagebox \wd\photobook@imagebox
}{% }{%
@ -1351,9 +1356,11 @@
\setlength\cellheight{% \setlength\cellheight{%
\mindim{\ht\photobook@imagebox}{\cellheight}}% \mindim{\ht\photobook@imagebox}{\cellheight}}%
\setlength\fboxsep{0pt}% \setlength\fboxsep{0pt}%
%\fbox{
\begin{minipage}[b][\cellheight][t]{\cellwidth}% \begin{minipage}[b][\cellheight][t]{\cellwidth}%
#2% #2%
\end{minipage}}% \end{minipage}}%
%}%
\endgroup\fi}% \endgroup\fi}%
\endgroup} \endgroup}