renderInContext: returns wrong CALayer shadow direction when interface is rotated
| Originator: | vp | ||
| Number: | rdar://17035663 | Date Originated: | 27-May-2014 |
| Status: | Open | Resolved: | |
| Product: | iOS | Product Version: | |
| Classification: | Reproducible: |
Summary: I've been rendering a UIWindow into an image. For that task, I build up a graphics context, configure its translation and rotation and call renderInContext. Sample code attached. The generated image looks fine, but the shadow is wrongly rendered whenever the device is in landscape. In the attached image, you notice that the white box in the top image (rendered image presented in Photoshop) has a top right shadow, whereas the simulator shows the shadow pointing to the right bottom (this is how it should be). The shadow offset of the layer is set to (2, 2). When I leave out the translation and rotation of the context, then the resulting shadow orientation is rendered correctly (but the remaining content is clipped). Steps to Reproduce: 1. Run the attached sample project. 2. Inspect the generated png Expected Results: Rendered image looks like in the simulator. Actual Results: The shadow of the white box is wrong. Version: iOS 7.1.1 Notes: Configuration: iPhone Simulator Attachments: 'DropShadowSample.zip' and 'screenshot.png' were successfully uploaded.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!