fix order of border rendering; remove z-index from selection borders (#1640)