Skip to content

Commit

Permalink
Merge branch 'main' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshenhai committed Dec 23, 2023
2 parents 1e659f3 + ba0e28a commit 2b96e6d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 42 deletions.
39 changes: 18 additions & 21 deletions src/en-US/guide/class-idraw.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@ const options = {
height: 400,
devicePixelRatio: 2
};
const config = {
scrollWrapper: {
use: true
}
};

const idraw = new iDraw(dom, options, config);
const idraw = new iDraw(dom, options);
```

| Arugment | Description | Type | Default | Required | Others |
Expand All @@ -31,26 +26,28 @@ type Options = {
width: number;
height: number;
devicePixelRatio: number;
disableScroll?: boolean;
disableSelect?: boolean;
disableScale?: boolean;
disableRuler?: boolean;
disableTextEdit?: boolean;
enableScroll?: boolean;
enableSelect?: boolean;
enableScale?: boolean;
enableRuler?: boolean;
enableTextEdit?: boolean;
enableDrag?: boolean;
};
```

### Options Properties

| Property | Description | Type | Default | Required | Others |
| ---------------- | ------------------------------ | --------- | ------- | -------- | ------ |
| width | Drawing board's width | `number` | - | `true` | - |
| height | Drawing board's height | `number` | - | `true` | - |
| devicePixelRatio | Device pixel scale | `number` | `1` | `false` | - |
| disableScroll | Disable canvas scroll | `boolean` | `false` | `false` | - |
| disableSelect | Disable canvas select elements | `boolean` | `false` | `false` | - |
| disableScale | Disable scale | `boolean` | `false` | `false` | - |
| disableRuler | Disable ruler | `boolean` | `false` | `false` | - |
| disableTextEdit | Disable editing text | `boolean` | `false` | `false` | - |
| Property | Description | Type | Default | Required | Others |
| ---------------- | ------------------------------------------------------------------- | --------- | ------- | -------- | ------ |
| width | Drawing board's width | `number` | - | `true` | - |
| height | Drawing board's height | `number` | - | `true` | - |
| devicePixelRatio | Device pixel scale | `number` | `1` | `false` | - |
| enableScroll | Enable canvas scroll | `boolean` | `true` | `false` | - |
| enableSelect | Enable canvas select elements, Mutually exclusive with `enableDrag` | `boolean` | `true` | `false` | - |
| enableScale | Enable scale | `boolean` | `true` | `false` | - |
| enableRuler | Enable ruler | `boolean` | `true` | `false` | - |
| enableTextEdit | Enable editing text | `boolean` | `true` | `false` | - |
| enableDrag | Enable drag feature, Mutually exclusive with `enableSelect` | `boolean` | `false` | `false` | - |

### Options Preivew

Expand Down
39 changes: 18 additions & 21 deletions src/zh-CN/guide/class-idraw.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@ const options = {
height: 400,
devicePixelRatio: 2
};
const config = {
scrollWrapper: {
use: true
}
};

const idraw = new iDraw(dom, options, config);
const idraw = new iDraw(dom, options);
```

在使用 `new iDraw(dom, options)` 类时,会接收三个参数。参数信息有下:
Expand All @@ -33,26 +28,28 @@ type Options = {
width: number;
height: number;
devicePixelRatio: number;
disableScroll?: boolean;
disableSelect?: boolean;
disableScale?: boolean;
disableRuler?: boolean;
disableTextEdit?: boolean;
enableScroll?: boolean;
enableSelect?: boolean;
enableScale?: boolean;
enableRuler?: boolean;
enableTextEdit?: boolean;
enableDrag?: boolean;
};
```

### Options 属性

| 属性 | 说明 | 类型 | 默认值 | 是否必填 | 备注 |
| ---------------- | ------------ | --------- | ------- | -------- | ---- |
| width | 画板宽度 | `number` | - | `true` | - |
| height | 画板高度 | `number` | - | `true` | - |
| devicePixelRatio | 设备像素比例 | `number` | `1` | `false` | - |
| disableScroll | 禁用滚动 | `boolean` | `false` | `false` | - |
| disableSelect | 禁用选择 | `boolean` | `false` | `false` | - |
| disableScale | 禁用缩放 | `boolean` | `false` | `false` | - |
| disableRuler | 禁用标尺 | `boolean` | `false` | `false` | - |
| disableTextEdit | 禁用文本编辑 | `boolean` | `false` | `false` | - |
| 属性 | 说明 | 类型 | 默认值 | 是否必填 | 备注 |
| ---------------- | ------------------------------------ | --------- | ------- | -------- | ---- |
| width | 画板宽度 | `number` | - | `true` | - |
| height | 画板高度 | `number` | - | `true` | - |
| devicePixelRatio | 设备像素比例 | `number` | `1` | `false` | - |
| enableScroll | 启用视图滚动 | `boolean` | `true` | `false` | - |
| enableSelect | 启用元素选择(和`enableDrag`互斥) | `boolean` | `true` | `false` | - |
| enableScale | 启用视图缩放 | `boolean` | `true` | `false` | - |
| enableRuler | 启用视图标尺 | `boolean` | `true` | `false` | - |
| enableTextEdit | 启用文本编辑 | `boolean` | `true` | `false` | - |
| enableDrag | 启用视图拖拽(和`enableSelect`互斥) | `boolean` | `false` | `false` | - |

### Options 效果预览

Expand Down

0 comments on commit 2b96e6d

Please sign in to comment.