diegomura / diegomura/react-pdf

LinearGradient Component does not allow for selecting gradient direction with x1, y1, and x2, y2

Open
#2,710 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

**Describe the bug**
LinearGradient props x1, x2, y1, y2 for defining the vector gradient direction do not work and end up removing the LinearGradient and it's Stops leaving you with just a single color rectangle with the Rect component.

![image](https://github.com/diegomura/react-pdf/assets/59669876/5545533e-6943-493e-b4bb-090ac7c1cc79)

**To Reproduce**
Code snippet:

JSX:
```

```

CSS:
```
scoreBg: {
position: 'absolute',
top: '0px',
left: '0px',
width: '100px',
height: 'auto',
zIndex: '1',
},
```

**Expected behavior**

An SVG Viewer provides the following with the same transcribed SVG code. The linear gradient direction is diagonal starting at (0 , 0) to (40 , 40) x1=0, y1=0, x2=40%, x2=40%

![image](https://github.com/diegomura/react-pdf/assets/59669876/271d9248-d230-42ef-9a2b-aae4b93542b0)

**Desktop:**

- OS: Windows
- Browser: Chrome
- React-pdf version "3.4.2",

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.