microsoft / microsoft/microsoft-ui-xaml

MultiColor Svg without viewBox is not showing on UI

Open
#10,598 3 comments 0 reactions 0 assignees View on GitHub
area-Images bug
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

![Image](https://github.com/user-attachments/assets/1277fae6-e155-43f7-990d-4b192ac6200a)

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]()

Image

### 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.