Commit c2984a9
committed
Fix iOS gradient rendering issues on screen and mutable images
- Fixed `DrawGradient.m` (OpenGL):
- Corrected vertex sizes to use requested width/height instead of power-of-two texture dimensions to prevent overflow/overlap.
- Implemented correct texture coordinate mapping (`maxS`, `maxT`) to avoid including padding.
- Updated vertex array logic to use `GL_FLOAT` for texture coordinates.
- Swapped logic for `GRADIENT_TYPE_HORIZONTAL` and `GRADIENT_TYPE_VERTICAL` to match standard coordinate system orientation.
- Fixed `IOSNative.m` (Mutable Images/CoreGraphics):
- Updated `fillRectRadialGradientMutable` to respect the `x` and `y` arguments for both the fill rect and the radial gradient center point, preventing it from always drawing at (0,0).
- Added proper clipping (`CGContextClipToRect`) to `fillRectRadialGradientMutable` to prevent gradients from bleeding outside their bounds.
- Added missing `CGGradientRelease` to fix a memory leak.
- Properly wrapped drawing calls in `CGContextSaveGState`/`CGContextRestoreGState` to isolate state changes.1 parent 3190c91 commit c2984a9
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2348 | 2348 | | |
2349 | 2349 | | |
2350 | 2350 | | |
| 2351 | + | |
| 2352 | + | |
2351 | 2353 | | |
2352 | 2354 | | |
2353 | 2355 | | |
2354 | 2356 | | |
2355 | 2357 | | |
2356 | 2358 | | |
| 2359 | + | |
| 2360 | + | |
2357 | 2361 | | |
2358 | 2362 | | |
2359 | 2363 | | |
| |||
0 commit comments