mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Summary: tisa. Algo is * Draw offscreen rect the size of the outset shadow (so accounting for spread) * Set g state to cast shadow in proper place ON screen * Clear out region in view The rects need to be offscreen for the following reasons * We need to account for spread radius, and CGContext shadows do not have support for this. So the only way to create a bigger shadow is the create a path that is the same size as the shadow we want * We cannot just position this rect onscreen with no offset (so the shadow is casting directly under it) since the blur will look unnatural * Offscreen means we do not see filled shadow rect but we do see the shadow it casts by offsetting it in the proper location Changelog: [Internal] Reviewed By: lenaic Differential Revision: D58881588 fbshipit-source-id: 2ea1b8945a3b9f182c4fb11668ac91a0ae7846ca