Fixed layer and shadow math after fixing width/height reversed bug