Added more complete highlighting functionality to TileMap and fixed some bugs with squared_segment_dist.