Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Having examined some of the similar questions (<a href="https://stackoverflow.com/questions/19858513/change-uiview-size-after-rotation-transform">Change uiview size after rotation transform</a> and <a href="https://stackoverflow.com/questions/12670750/how-to-resize-the-uiview-when-cgaffinetransformidentity">How to resize the UIView when CGAffineTransformIdentity</a>) and read the <a href="https://developer.apple.com/library/mac/documentation/graphicsimaging/reference/CGAffineTransform/Reference/reference.html" rel="nofollow noreferrer">Official documentation about CGAffineTransform</a> I have come to some simple conclusions. Will explain them below.</p> <p>When you use <code>CGAffineTransform</code> for some object with followed frame transform you must use some rules for obtain correct result: </p> <ol> <li><p>If transform property of object is equal <code>CGAffineTransformIdentity</code> you can change frame of object or use <code>CGAffineTransform</code> without restriction.</p></li> <li><p>If If transform property of object is not equal <code>CGAffineTransformIdentity</code> and you want change frame of object without <code>CGAffineTransform</code>:<br> a) save value of object transform to some local (or another type) variable<br> b) set transform property of object to CGAffineTransformIdentity<br> c) change frame of object<br> d) restore transform value from local (or another type) variable.</p></li> <li>If transform property of object is not equal <code>CGAffineTransformIdentity</code> and you want use <code>CGAffineTransform</code>, for example <code>new_transform</code>:<br> a) use <code>CGAffineTransformConcat([object transform] , new_transform)</code> to obtain <code>result_transform</code><br> b) set transform value of object to <code>result_transform</code> </li> </ol> <p>Compliance with these simple rules will help avoid many problems.</p> <p>Note: you must remember, when you use <code>CGAffineTransformConcat</code> all transform totalized. For example: if you want rotate object from 6 degree to 7 degree, you must add transform rotate to 1 degree, not to 7. Otherwise you obtain rotation 6 + 7 = 13 degree.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload