fix for boundary problems (raycaster skipped borders)