How I can substract one CGRect
from another? I want the result R1 - R2
to be the largest subrectangle of R1 that does not intersect R2.
Example 1:
+----------------------------------+ | +--------+ | | | R2 | | | | | | | +--------+ R1 | | | | | | | +----------------------------------+
R3 = CGRectSubstract(R2,R1);
+----------------------+ | | | | | | | R3 | | | | | | | +----------------------+
Example 2:
+-----------------------+----------+ | | | | | R2 | | | | | R1 +----------+ | | | | | | +----------------------------------+
R3 = CGRectSubstract(R2,R1);
+-----------------------+ | | | | | | | R3 | | | | | | | +-----------------------+
Example 3:
+----------------------------------+ | | | | | | | R1 | | +---------+ | | | | | | | R2 | | +---------+---------+--------------+
R3 = CGRectSubstract(R2,R1);
+----------------------------------+ | | | | | R3 | | | +----------------------------------+