[Tex/LaTex] setbeamersize influence the block environment

beamerpaper-size

I use the code

\setbeamersize{text margin left=1pt,text margin right=1pt}

in order to make my picture bigger shown.

But when I use the block environment. It make the block run off the edges.
How can I solve it? Or just temporarily cancel the beamersize.

My MWE is

\documentclass[presentation]{beamer}
\let\Tiny\tiny
\usepackage{hyperref}
\usetheme[50]{Berkeley}
\setbeamersize{text margin left=1pt,text margin right=1pt}
\makeatletter
\beamer@headheight=1.5\baselineskip
\makeatother
\newcommand\Rey{\mbox{\textit{Re}}}

\begin{document}



\section{A section}
\subsection{AAA \protect \Rey }
\begin{block}{AAAAA}
AAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAA
\end{block}
\end{document}

Best Answer

Possibility One

The easiest way would be, not modifying the margins! If you want a picture to be shown bigger there are other ways, e.g.

\documentclass{beamer}

\usetheme{Warsaw}             

\begin{document}

    \begin{frame}
        \hspace*{-1cm}
        \includegraphics[width=1.16\textwidth]{example-grid-100x100bp.pdf}
    \end{frame}

    \begin{frame}
        \begin{block}{test}
            blub
        \end{block}
    \end{frame}

\end{document}

Second Possibility

If you insist on the tiny margins, than you can put the blocks into minipages of the desired width:

\documentclass{beamer}

\usetheme{Warsaw}        

\setbeamersize{text margin left=1pt,text margin right=1pt}     

\begin{document}

    \begin{frame}
        \includegraphics[width=\textwidth]{example-grid-100x100bp.pdf}
    \end{frame}

    \begin{frame}
        \begin{center}
            \begin{minipage}{.9\textwidth}
                \begin{block}{test}
                    blub
                \end{block} 
            \end{minipage}
        \end{center}
    \end{frame}

\end{document}

enter image description here