From 664ed4b92c5e792dcf275ba062a00d6c2e699c3b Mon Sep 17 00:00:00 2001
From: Aaron LI <aly@aaronly.me>
Date: Fri, 6 Dec 2024 09:31:06 +0800
Subject: class: Fix the case of no photo

---
 resume.cls | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

(limited to 'resume.cls')

diff --git a/resume.cls b/resume.cls
index 2d08b2c..1bea11d 100644
--- a/resume.cls
+++ b/resume.cls
@@ -324,14 +324,14 @@
 
 % Render resume header
 \newcommand*{\makeheader}{
-  \ifdef{\@photo@width}{
-    \def\@profile@width{\dimexpr \linewidth - \@photo@width - 1em}%
-  }{
+  \ifdef{\@photo}{%
+    \def\@profile@width{\dimexpr \linewidth - \@photo@width - 1em}
+    \ifdefstring{\@photo@position}{left}{%
+      \@photo\hspace{1em}%
+    }{}%
+  }{%
     \def\@profile@width{\linewidth}
   }%
-  \ifdefstring{\@photo@position}{left}{%
-    \@photo\hspace{1em}%
-  }{}%
   \begin{minipage}{\@profile@width}
     {\LARGE\bfseries\color{accentcolor} \@name}
     \ifdef{\@tagline}{%
@@ -341,8 +341,10 @@
     \medskip \\
     \@profile
   \end{minipage}
-  % photo on the right side
-  \ifdefstring{\@photo@position}{left}{}{\hfill\@photo}
+  \ifdef{\@photo}{%
+    % photo on the right side
+    \ifdefstring{\@photo@position}{left}{}{\hfill\@photo}
+  }{}
 }
 
 %%
-- 
cgit v1.2.2

