Skip to content

Commit

Permalink
[modify] Upgrade npm version
Browse files Browse the repository at this point in the history
  • Loading branch information
YaoKaiLun committed Feb 16, 2020
1 parent 765ad10 commit 06736e8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@

react-img-editor 是一个图像编辑器 react 组件,支持对图片进行裁剪、涂鸦、文字编辑、马赛克处理等操作,同时支持自定义插件和灵活的样式配置。

![示例](https://s2.ax1x.com/2020/02/13/1qUQzj.png)
![示例](https://s2.ax1x.com/2020/02/16/39gZcD.png)

## 安装
## ✨ 特性

- 支持自由画笔、矩形、圆形、箭头、文字、马赛克的绘制
- 支持橡皮擦、撤销操作、截图和图片下载
- 支持自定义插件和工具栏配置
- 支持矩形、圆形、箭头、文字等节点的拉伸、拖拽和删除
- 支持同一页面多个组件同时存在

## 📦 下载

```
npm install react-img-editor -S
```

## 引入
## 🔨 引入和使用

```
import ReactImgEditor from 'react-img-editor'
Expand All @@ -19,7 +27,7 @@ import 'react-img-editor/assets/index.css'
<ReactImgEditor src="https://www.w3schools.com/html/img_girl.jpg" />
```

## API
## 🧰 API

| 属性 | 描述 | 类型 | 默认值 |
| --- | --- | --- | --- |
Expand All @@ -33,10 +41,8 @@ import 'react-img-editor/assets/index.css'
| defaultPluginName | 默认选中的插件名称 | string? | - |


**TODO**
## 📝 TODO

- [x] 优化撤销操作性能
- [x] 支持绘制元素的移动和删除,及移动和删除操作的撤销
- [ ] 支持同一页面多个组件同时存在
- [ ] 裁剪画出范围异常修复
- [ ] 动态加载图片
- [ ] 裁剪画出范围异常修复
- [ ] 下载图片类型配置
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-img-editor",
"version": "0.1.1",
"version": "0.1.2",
"description": "图片编辑器(微信截图编辑 PRO 版)",
"keywords": [
"react-img-editor",
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/Pen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export default class Pen extends Plugin {
points: [pos.x, pos.y],
dashEnabled: !!(paramValue && paramValue.lineType && paramValue.lineType === 'dash'),
dash: [8],
tension: 1,
lineCap: 'round',
lineJoin: 'round',
})
layer.add(this.lastLine)
}
Expand Down

0 comments on commit 06736e8

Please sign in to comment.