diff options
author | Karl Berry <karl@freefriends.org> | 2014-08-29 22:35:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-08-29 22:35:25 +0000 |
commit | 20255e2c3347ec299f3e847178a21ecc760bb604 (patch) | |
tree | 6836a46d1f0ff423c6e0433fcd949fc819508185 /Master/texmf-dist/tex | |
parent | cf377123b6b1a030e53f2cf050fd8a944fe93ae3 (diff) |
reflectgraphics (29aug14)
git-svn-id: svn://tug.org/texlive/trunk@35064 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/reflectgraphics/reflectgraphics.sty | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/reflectgraphics/reflectgraphics.sty b/Master/texmf-dist/tex/latex/reflectgraphics/reflectgraphics.sty index 1468134c004..5fc897ad097 100644 --- a/Master/texmf-dist/tex/latex/reflectgraphics/reflectgraphics.sty +++ b/Master/texmf-dist/tex/latex/reflectgraphics/reflectgraphics.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2013 by Oliver Reiche <oliver.reiche@gmail.com> +%% Copyright (C) 2014 by Oliver Reiche <oliver.reiche@gmail.com> %% -------------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -20,7 +20,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{reflectgraphics} - [2013/11/17 v0.2 Fancy reflections for LaTeX graphics] + [2014/08/29 v0.2b Fancy reflections for LaTeX graphics] \RequirePackage{kvoptions, keyval, graphicx, calc, tikz} \usetikzlibrary{fadings} \makeatletter @@ -136,18 +136,23 @@ \setlength{\rg@grp@width}{\rg@width}% \setlength{\rg@grp@height}{\rg@height}% \else% - \settowidth{\rg@grp@width}{% - \includegraphics[% - draft,% - width=\rg@width,% - height=\rg@height,% - angle=\rg@angle]{#2}}% - \settoheight{\rg@grp@height}{% - \includegraphics[% - draft,% - width=\rg@width,% - height=\rg@height,% - angle=\rg@angle]{#2}}% + \ifdim\rg@height>\rg@width% + \pgfmathsetmacro{\rg@alpha}{atan(\rg@height/\rg@width)}% + \else% + \pgfmathsetmacro{\rg@alpha}{atan(1/(\rg@width/\rg@height)}% + \fi% + \pgfmathsetmacro{\rg@corner}{abs(cos(\rg@alpha))}% + \pgfmathsetmacro{\rg@cornera}{abs(cos(\rg@alpha+\rg@angle))}% + \pgfmathsetmacro{\rg@cornerb}{abs(cos(180-\rg@alpha+\rg@angle))}% + \pgfmathsetmacro{\rg@scale@x}{% + max(\rg@cornera/\rg@corner,\rg@cornerb/\rg@corner)}% + \pgfmathsetmacro{\rg@corner}{abs(sin(\rg@alpha))}% + \pgfmathsetmacro{\rg@cornera}{abs(sin(\rg@alpha+\rg@angle))}% + \pgfmathsetmacro{\rg@cornerb}{abs(sin(180-\rg@alpha+\rg@angle))}% + \pgfmathsetmacro{\rg@scale@y}{% + max(\rg@cornera/\rg@corner,\rg@cornerb/\rg@corner)}% + \setlength{\rg@grp@width}{\rg@scale@x\rg@width}% + \setlength{\rg@grp@height}{\rg@scale@y\rg@height}% \fi% \setlength{\rg@ref@height}{% \rg@length\rg@grp@height}% |