mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-23 21:05:08 +00:00
### Description Fixes swapped red/blue channels when rendering SVG images. #### Describe the bug When rendering a full-color SVG into an Image object using Image::from_bytes(ImageFormat::Svg, ...) on macOS, the resulting bitmap has its Red and Blue channels swapped. For example, a color specified as #38BDF8 (Light Blue) in the SVG source appears as yellowish in the rendered GPUI view. #### Steps to reproduce 1. Create a GPUI application. 1. Generate or load an SVG string containing a specific color, for example: ```xml <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> <rect width="100" height="100" fill="#38BDF8"/> </svg> ``` 3. Load this SVG into an Image object: ```rust let image = Arc::new(Image::from_bytes( ImageFormat::Svg, svg_string.into_bytes(), )); ``` 4. Display this image in a view using an img() element. #### Expected behavior The rectangle should be rendered in **Light Blue (#38BDF8)**. #### Actual behavior The rectangle is rendered in **Yellowish Color (#F8BD38)**. ### Self-Review Checklist: - [X] I've reviewed my own diff for quality, security, and reliability - [X] Unsafe blocks (if any) have justifying comments - [X] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [X] Tests cover the new/changed behavior - [X] Performance impact has been considered and is acceptable ### Closes #ISSUE ### Release Notes: - Fixed swapped color channels when pasting SVG images from the clipboard. --------- Co-authored-by: MrSubidubi <finn@zed.dev> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||