diff --git a/src/en-US/guide/class-idraw.md b/src/en-US/guide/class-idraw.md index 38ff91a..350bbf2 100644 --- a/src/en-US/guide/class-idraw.md +++ b/src/en-US/guide/class-idraw.md @@ -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 | @@ -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 diff --git a/src/zh-CN/guide/class-idraw.md b/src/zh-CN/guide/class-idraw.md index 3204570..572d0c6 100644 --- a/src/zh-CN/guide/class-idraw.md +++ b/src/zh-CN/guide/class-idraw.md @@ -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)` 类时,会接收三个参数。参数信息有下: @@ -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 效果预览