Skip to content

Commit 8d7e426

Browse files
committed
Fix #44 modify maskUnits in mask
* update changelog and package.json
1 parent 2bbca09 commit 8d7e426

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

CHANGELOG.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,22 @@
44

55
### Added
66

7-
- Upgraded all dependencies
8-
- Moved to DTS (tsdx fork) instead of nx
9-
- Add cypress tests
7+
- Add cypress tests for all props and events
108
- Added `onStroke` prop to get last stroke on pointer up
119
- Adds a point on click (without moving) #45
12-
- Fix partial transparent erase (eraser stroke color changed to black for masking) #44
10+
11+
### Changed
12+
13+
- Upgraded all dependencies
14+
- Moved to DTS (tsdx fork) instead of nx
15+
- Switched codebase to hook based implementation (support react >= 16.8)
16+
- Removed immer dependency
1317

1418
### Fixed
1519

1620
- Changed React import to \* from React #40
1721
- Export image fails when the background is not an image [beta] #46
22+
- Fix partial transparent erase (eraser stroke color changed to black for masking, add maskUnits) #44
1823

1924
### Breaking changes
2025

@@ -119,7 +124,7 @@ Added README :)
119124

120125
- Fixed sketch offset issue when the canvas is scrolled
121126

122-
#### Changed
127+
### Changed
123128

124129
- Updated undo/redo/reset strategy
125130
- Updated demo in storybook
@@ -137,13 +142,13 @@ Added README :)
137142

138143
## [3.0.1]
139144

140-
#### Changed
145+
### Changed
141146

142147
- Moved immutable dependency from Canvas file
143148

144149
## [3.0.0]
145150

146-
#### Changed
151+
### Changed
147152

148153
Removed onUpdate feature and made the system modular
149154

@@ -189,7 +194,7 @@ allowOnlyPointerType
189194
- Export and load paths
190195
- Erase mode and eraser width
191196

192-
#### Changed
197+
### Changed
193198

194199
- Rename exportAsImage() to exportImage() for naming consistency
195200

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
},
106106
"dependencies": {},
107107
"peerDependencies": {
108-
"react": ">=16.4"
108+
"react": ">=16.8"
109109
},
110110
"publishConfig": {
111111
"registry": "https://registry.npmjs.org/"

src/Canvas/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,11 @@ release drawing even when point goes out of canvas */
331331
)}
332332

333333
{eraserPaths.map((_, i) => (
334-
<mask id={`eraser-mask-${i}`} key={`eraser-mask-${i}`}>
334+
<mask
335+
id={`eraser-mask-${i}`}
336+
key={`eraser-mask-${i}`}
337+
maskUnits="userSpaceOnUse"
338+
>
335339
<use href="#mask-background" />
336340
{Array.from(
337341
{ length: eraserPaths.length - i },

0 commit comments

Comments
 (0)