From 42b82c7597e89fadde85939a364fa8d8aa24f2fa Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 24 Nov 2013 00:00:00 +0000
Subject: pdf-trans (23nov13)

git-svn-id: svn://tug.org/texlive/trunk@32223 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/generic/pdf-trans/pdf-trans.tex | 28 ++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)

(limited to 'Master/texmf-dist/tex/generic/pdf-trans/pdf-trans.tex')

diff --git a/Master/texmf-dist/tex/generic/pdf-trans/pdf-trans.tex b/Master/texmf-dist/tex/generic/pdf-trans/pdf-trans.tex
index cca00c7d7d1..4326d3187d3 100644
--- a/Master/texmf-dist/tex/generic/pdf-trans/pdf-trans.tex
+++ b/Master/texmf-dist/tex/generic/pdf-trans/pdf-trans.tex
@@ -1,13 +1,12 @@
 %%% A set of macros for various transformations of TeX boxes.
 %%% (bases on plain and pdfeTeX primitives)
 %
-% Version: 2.2
+% Version: 2.3
 % Author: Pawe/l Jackowski (P.Jackowski@gust.org.pl)
 % Public Domain
 %
 % The macro provides a bunch of TeX box transformations. It was initially
-% inspired by trans.tex (BOP, bop@bop.com.pl), remade to work with pdfeTeX.
-% This standalone code gathers parts of pdfeplay macro package.
+% inspired by trans.tex (BOP, bop@bop.com.pl), remade to work with pdf(e)TeX.
 %
 % Files:
 %     pdf-trans.tex
@@ -32,6 +31,13 @@
 %             - \bboxtrans vs \cboxtrans switches
 %             - \boxext* stuff; yet another scaling approach
 %
+%     10.2013, v2.3
+%         * nasty bug in \roundbponce; a sign was dropped when the number
+%           had no integer part (-0.99234 was rounded to 0.99). In current
+%           implementation small negative numbers might be rounded to -0.0
+%           (minus sign remains)
+%         * \roundbponce renamed to \round:bp:once
+%
 
 \def\starttrans{%
  \xdef\endtrans{%
@@ -1049,10 +1055,10 @@
  \expandafter\with@ut:pt\the\dimexpr(#1)*\pt:f@ctor/\bp:f@ctor\relax0000\relax}
 
 \def\r@und:bp:    #1.#2#3\relax{\number\numexpr#1#2/10\relax}
-\def\r@und:bp:i   #1.#2#3#4\relax{\roundbponce{#1}{#2#3}\relax}
-\def\r@und:bp:ii  #1.#2#3#4#5\relax{\roundbponce{#1}{#2#3#4}\relax}
-\def\r@und:bp:iii #1.#2#3#4#5#6\relax{\roundbponce{#1}{#2#3#4#5}\relax}
-\def\r@und:bp:iv  #1.#2#3#4#5#6#7\relax{\roundbponce{#1}{#2#3#4#5#6}\relax}
+\def\r@und:bp:i   #1.#2#3#4\relax{\round:bp:once{#1}{#2#3}\relax}
+\def\r@und:bp:ii  #1.#2#3#4#5\relax{\round:bp:once{#1}{#2#3#4}\relax}
+\def\r@und:bp:iii #1.#2#3#4#5#6\relax{\round:bp:once{#1}{#2#3#4#5}\relax}
+\def\r@und:bp:iv  #1.#2#3#4#5#6#7\relax{\round:bp:once{#1}{#2#3#4#5#6}\relax}
 
 % To speed-up things one may say
 
@@ -1063,9 +1069,11 @@
   \unexpanded{\expandafter\with@ut:pt\the}%
   \dimexpr(##1)*\unexpanded{\pt:f@ctor/\bp:f@ctor}\relax0000\relax}}
 
-\def\roundbponce#1#2{%
- \number\numexpr#1\ifnum#1<0-\else+\fi
- (\m@ne+\expandafter\r@und:bp:once\number\numexpr1#2/10\relax}
+\def\round:bp:once#1#2{%
+ %\number\numexpr#1\ifnum#1<0-\else+\fi % 15.10.2013: wrong! that drops minus sign in case -0.xxxx
+ %(\m@ne+\expandafter\r@und:bp:once\number\numexpr1#2/10\relax}
+ \ifnum#11<0-\number\numexpr-\else\number\numexpr\fi
+ #1+(\m@ne+\expandafter\r@und:bp:once\number\numexpr1#2/10\relax}
 
 \def\r@und:bp:once#1#2\relax{#1)\relax\ifnum#2>0.#2\fi}
 
-- 
cgit v1.2.3

