どうすればCGRect
別のものから減算できますか? R1 - R2
結果を、R2 と交差しない R1 の最大のサブ長方形にしたいと考えています。
例 1 :
+---------------------------------+ | | +--------+ | | | | | R2 | | | | | | | | | | | | | +--------+ R1 | | | | | | | | | | | | | +---------------------------------+
R3 = CGRectSubstract(R2,R1);
+---------------------+ | | | | | | | | | | | | | | R3 | | | | | | | | | | | | | +---------------------+
例 2 :
+-------------------------------------+----------+ | | | | | | | | | | R2 | | | | | | | | | R1 +---------+ | | | | | | | | | | | | +---------------------------------+
R3 = CGRectSubstract(R2,R1);
+ -----------------------+ | | | | | | | | | | | | | | R3 | | | | | | | | | | | | | + -----------------------+
例 3 :
+---------------------------------+ | | | | | | | | | | | | | | R1 | | | +---------+ | | | | | | | | | | | | | R2 | | | +---------+---------+--------------+
R3 = CGRectSubstract(R2,R1);
+---------------------------------+ | | | | | | | | | | R3 | | | | | +---------------------------------+