shadow: fix small bug in determine whether shadow should be drawn