take BORDER into account for selection. (thx Petr Sabata)