From 4591f06237edf1a78f266a1f64217eb51e57c6a9 Mon Sep 17 00:00:00 2001
From: Eugeniy Mikhailov <evgmik@gmail.com>
Date: Mon, 29 Dec 2014 00:56:52 -0500
Subject: rework header so it automaticly line up logo and WM address

---
 wmletterhead.cls | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

(limited to 'wmletterhead.cls')

diff --git a/wmletterhead.cls b/wmletterhead.cls
index 0faa98a..c0d654a 100644
--- a/wmletterhead.cls
+++ b/wmletterhead.cls
@@ -104,6 +104,7 @@
 
 
 \newlength{\wmaddressheight} % to be calculated at the opening
+\newlength{\wmaddresstotalheight}
 \newlength{\wmaddresswidth}
 \newlength{\wmaddresshpos}
 % --------------------------------------------------
@@ -139,25 +140,18 @@
 }
 
 \newcommand{\setwmaddresssizes}{
-  \settototalheight{\wmaddressheight}{\hbox{\wmaddress}}%
+  \settototalheight{\wmaddresstotalheight}{\hbox{\wmaddress}}%
+  \settoheight{\wmaddressheight}{\hbox{\wmaddress}}%
   \settowidth{\wmaddresswidth}{\hbox{\wmaddress}}%
 }
 
 \newcommand{\wmfromwithlogo}{
   \setwmaddresssizes
-    %\hskip -\wmlogoWhpos
-    %\includegraphics[height=\wmlogoheight{},keepaspectratio=true]{\wmheaderlogo}
-  \parbox[t]{\textwidth}{
-    \raisebox{\wmlogoWvpos}{
-      \parbox[t]{\textwidth-\wmaddresswidth}{
-        \hskip -\wmlogoWhpos
-          \includegraphics[height=\wmlogoheight{},keepaspectratio=true]{\wmheaderlogo}
-      }
+    \raisebox{\wmaddressheight-\wmlogoheight+\wmlogoWvpos}[\wmaddressheight]{
+      \hskip -\wmlogoWhpos%
+        \includegraphics[height=\wmlogoheight{},keepaspectratio=true]{\wmheaderlogo}
     }
-    \parbox[t]{\wmaddresswidth}{
-      \wmaddress{}
-    }
-  }
+  \hfill\wmaddress{}%
 }
 
 
-- 
cgit v1.2.3

