microsoft / microsoft/microsoft-ui-xaml
MultiColor Svg without viewBox is not showing on UI
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug

We have one SVG where Width & height attributes are present but the ViewBox attribute is missing.
To rendered the SVG on UI we removed width & height part. This process we are doing for all SVG. But in this case as viewBox is not present this SVG is not showing in UI. Problem is we can't add the ViewBox Attribute as it depends on width & height. These Width & height is in string it can be in pixel(like 150px), exact value(150) or in % (150%).
This SVG after removing width & height also we can view in browser but not able to view through XAML image object.
Rendering Logic: [MultiColor]()
### Steps to reproduce the bug
Attached SVG file : Contoso
### Expected behavior
_No response_
### Screenshots
_No response_
### NuGet package version
None
### Windows version
_No response_
### Additional context
_No response_
Contributor guide
Research direction
Start with the attached Contoso SVG and the MultiColor rendering logic, focusing on how a XAML Image object handles SVGs with width and height but no viewBox. Reproduce the rendering failure and verify that this class of SVG displays in the UI without breaking the existing handling of pixel, exact-value, and percentage dimensions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100