Good for you for "nailing this one" on
speculation,
G-Man!
Samifox, in the future, I would suggest that you try to (please) be a little more clear with your problem, as best as you can. And, should words fail you, then include a visual example of what it is you are trying to achieve.
For example, you should have stated that your shapes were on the same layer. It's difficult for anyone to find a solution when the "facts" of the problem aren't obvious. I, personally, read your query "umpteen times", trying to figure out exactly what you mean't...