Skip to content

Commit bfd16bc

Browse files
committed
fix(*): bugs
1 parent 0dfd0d2 commit bfd16bc

File tree

4 files changed

+23
-27
lines changed

4 files changed

+23
-27
lines changed

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# BPDCore v1.0 说明文档
1+
# BPDCore v1.1.0-beta 说明文档
22

33
BPD-Core 是 web 形式的 bpmn 设计器,BPD-Core 仅提供建模和渲染, 不提供相应页面
44

@@ -78,16 +78,17 @@ new BPDCore({
7878

7979
## 配置
8080

81-
| 参数 | 说明 | 类型 | 默认值 |
82-
| ---------- | ---------------------------- | ------------------------- | ------ |
83-
| container | 容器 | string | - |
84-
| readonly | 只读 | boolean | false |
85-
| extensions | 扩展属性(参考 extensions.js) | { key: json } | - |
86-
| filter | 需要过滤的节点类型 | [bpmnName] | [] |
87-
| local | 国际化 | "zh_CN"\|"zh_TW"\|"en_US" | zh_CN |
88-
| bpmnStyle | 节点样式 | {bpmnName: {}} | - |
89-
| shapeStyle | 特定节点样式 | [{nodeId, fillStyle}] | - |
90-
| config | 功能配置 | {} | - |
81+
| 参数 | 说明 | 类型 | 默认值 |
82+
| ---------- | ---------------------------- | ------------------------- | ------- |
83+
| container | 容器 | string | - |
84+
| definition | 流程定义(xml) | string | default |
85+
| readonly | 只读 | boolean | false |
86+
| extensions | 扩展属性(参考 extensions.js) | { key: json } | - |
87+
| filter | 需要过滤的节点类型 | [bpmnName] | [] |
88+
| local | 国际化 | "zh_CN"\|"zh_TW"\|"en_US" | zh_CN |
89+
| bpmnStyle | 节点样式 | {bpmnName: {}} | - |
90+
| shapeStyle | 特定节点样式 | [{nodeId, fillStyle}] | - |
91+
| config | 功能配置 | {} | - |
9192

9293
## 功能配置
9394

@@ -134,6 +135,7 @@ new BPDCore({
134135
| updateProperties | 更新元素属性 | shapeId,data | 目前仅支持标题和扩展属性 |
135136
| updateProcessProperties | 更新流程属性 | data | 目前仅支持标题和扩展属性 |
136137
| updataLineStyle | 更新图形边框颜色 | id, style | |
138+
| activateSelect | 激活选择模式 | - | |
137139
| destroy | 销毁设计器 | - | - |
138140
| importBpmn | 导入解析 xml 文件 | xml,callback | 回调函数 |
139141
| exportBpmn | 导出 xml | callback | 回调函数 |
@@ -182,6 +184,5 @@ new BPDCore({
182184

183185
## 未来
184186

185-
- 画布拖拽
186187
- 操作记录
187188
- 其他快捷键

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bpd-core",
3-
"version": "1.0.0",
3+
"version": "1.1.0-beta.1",
44
"author": "Ctank",
55
"main": "index.js",
66
"repository": "https://github.com/ctank/bpd-core.git",
@@ -55,7 +55,7 @@
5555
"webpack-dev-server": "^3.3.1",
5656
"webpack-hot-middleware": "^2.21.0"
5757
},
58-
"license": "ISC",
58+
"license": "MIT",
5959
"engines": {
6060
"node": ">= 6.0.0",
6161
"npm": ">= 3.0.0"

src/draw/drawUtils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,15 +1537,16 @@ const getPointAngle = ($container, id, x, y, padding) => {
15371537
* @param {*} y
15381538
* @param {*} elm
15391539
*/
1540-
const getRelativePos = (x, y, $elm) => {
1540+
const getRelativePos = (x, y, $elm, $layout) => {
15411541
const offset = $elm.offset()
1542+
const position = $elm.children().position()
15421543
if (offset == null) {
15431544
offset.left = 0
15441545
offset.top = 0
15451546
}
15461547
return {
1547-
x: x - offset.left + $elm.scrollLeft(),
1548-
y: y - offset.top + $elm.scrollTop()
1548+
x: x - offset.left + Math.abs(position.left),
1549+
y: y - offset.top + Math.abs(position.top)
15491550
}
15501551
}
15511552

src/draw/operation.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ class Operation {
3939

4040
/**
4141
* 画布鼠标移动事件
42-
* @param {*} $this
42+
* @param {*} e
4343
*/
44-
move($this) {
45-
const { $container, designer } = this
44+
move(e) {
45+
const { $container } = this
4646
if ($container) {
47-
const $layout = $container.find('.bpd-layout')
48-
const layoutPos = $layout.offset()
4947
const $designer = $container.find('.bpd-designer')
5048
const data = {
5149
state: this.state
@@ -56,11 +54,7 @@ class Operation {
5654

5755
this.destroy()
5856

59-
const mousePos = DrawUtils.getRelativePos(
60-
$this.pageX + Math.abs(layoutPos.left),
61-
$this.pageY + Math.abs(layoutPos.top),
62-
$container
63-
)
57+
const mousePos = DrawUtils.getRelativePos(e.pageX, e.pageY, $container)
6458
const shapeData = DrawUtils.getShapeByPosition(
6559
mousePos.x,
6660
mousePos.y,

0 commit comments

Comments
 (0)