Oh wait, when Link is drowning it is the same as a pit. He shifts to the center of the tile. Swimming however is what I described above. And for corners you need to check the tiles in the other direction. For example when you move in the water vertically you check the tile to the left and the right if they are also water. If one of them is not, for example the right, you move Link to the other side, the left, until he is far enough away from the other tile. If both are not water the move Link to the center of the tile.