Skip to content

content is not center if the viewbox origin is not (0,0) #2078

Open
@kinfkong

Description

@kinfkong

Bug

When the viewbox's origin is not (0, 0), and the shape of the svg width/height is not the same as viewbox. The content of the svg is not center (even explictly set preserveAspectRatio='xMidYMid meet')

  <Svg width="300" height="700" viewBox="50 50 100 100" preserveAspectRatio='xMidYMid meet'>
    <Rect x="50" y="50" width="100" height="100" fill="yellow"></Rect>
  </Svg>

Unexpected behavior

the svg content is not centered
Note, this bug seems exists only for native (iOS and Android), if I am using Expo react-native-svg in web platform, it works perfectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions