This scenario is covered in the laws of the game.
In the section entitled, "Guidelines for Match Officials," you will find the following illustration and explanatory text.
I'm not sure what you mean by, "The law just says offside is then called." I don't see anything to that effect, either...