This illusion is really not caused by your screen. You can make sure of it
if you try to draw it on a piece of paper.
In fact the steep sloping lines in Figure 1 cause that the vertical sides
of the squares seem to be inclined in the opposite direction.
In Figure 2 gentle sloping lines cause that the horizontal sides of the
squares seem to be inclined in the opposite direction.
If you become to practice by yourself you will notice that the less the
angle between the sloping lines and the respective sides of the squares
in Figure 1,
Figure 2, respectively), the more these squares seem to be distorted.