diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f187da..6ebee77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ +## 0.11.5 + +修复参考线吸附与错误位移bug + +修改旋转回正的位置 + ## 0.11.4 修复参考线bug diff --git a/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md b/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md index 7b6cf64..3749bfa 100644 --- a/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md +++ b/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md @@ -5,6 +5,9 @@ nav: title: change log order: 6 --- +## 0.11.5 +Fix reference line adsorption and wrong displacement bug +Change the position of the rotation justification ## 0.11.4 Fix guide line bug Optimized drag and drop algorithm diff --git a/packages/dooringx-dumi-doc/docs/ChangeLog/index.md b/packages/dooringx-dumi-doc/docs/ChangeLog/index.md index 0607981..6935615 100644 --- a/packages/dooringx-dumi-doc/docs/ChangeLog/index.md +++ b/packages/dooringx-dumi-doc/docs/ChangeLog/index.md @@ -6,6 +6,12 @@ nav: order: 6 --- +## 0.11.5 + +修复参考线吸附与错误位移bug + +修改旋转回正的位置 + ## 0.11.4 修复参考线bug diff --git a/packages/dooringx-lib/package.json b/packages/dooringx-lib/package.json index 5cc6486..a51a001 100644 --- a/packages/dooringx-lib/package.json +++ b/packages/dooringx-lib/package.json @@ -1,5 +1,5 @@ { - "version": "0.11.4", + "version": "0.11.5", "license": "MIT", "main": "dist/index.js", "module": "dist/dooringx-lib.esm.js", diff --git a/packages/dooringx-lib/src/core/markline/calcRender.ts b/packages/dooringx-lib/src/core/markline/calcRender.ts index 51f1582..573f87b 100644 --- a/packages/dooringx-lib/src/core/markline/calcRender.ts +++ b/packages/dooringx-lib/src/core/markline/calcRender.ts @@ -176,7 +176,6 @@ export function marklineCalRender(config: UserConfig, iframe: boolean): LinesTyp 'r-l' ); } - const indexTopBottom = binarySearchRemain( realStyle.top, marklineState.sortBottom, diff --git a/packages/dooringx-lib/src/core/markline/normalMode.ts b/packages/dooringx-lib/src/core/markline/normalMode.ts index f406751..138db1b 100644 --- a/packages/dooringx-lib/src/core/markline/normalMode.ts +++ b/packages/dooringx-lib/src/core/markline/normalMode.ts @@ -32,97 +32,96 @@ export function marklineDisplay( direction: 'left' | 'top' | 'bottom' | 'right' | 't-b' | 'b-t' | 'l-r' | 'r-l' ) { const { top, height, left, width } = focusStyle; - let { dirtyX, dirtyY } = dirty; const { top: t, height: h, left: l, width: w } = unFocusStyle; let diffY = 0; let diffX = 0; switch (direction) { case 'left': - if (dirtyY) { - if (diff === 0) { + if (dirty.dirtyY) { + if (diff <= 1) { lines.y.push(l); } } else { lines.y.push(l); diffX = l - left; - dirtyY = true; + dirty.dirtyY = true; } break; case 'right': - if (dirtyY) { - if (diff === 0) { + if (dirty.dirtyY) { + if (diff <= 1) { lines.y.push(l + w); } } else { lines.y.push(l + w); diffX = l + w - left - width; - dirtyY = true; + dirty.dirtyY = true; } break; case 'l-r': - if (dirtyY) { - if (diff === 0) { + if (dirty.dirtyY) { + if (diff <= 1) { lines.y.push(l + w); } } else { lines.y.push(l + w); diffX = l + w - left; - dirtyY = true; + dirty.dirtyY = true; } break; case 'r-l': - if (dirtyY) { - if (diff === 0) { + if (dirty.dirtyY) { + if (diff <= 1) { lines.y.push(l); } } else { lines.y.push(l); diffX = l - (left + width); - dirtyY = true; + dirty.dirtyY = true; } break; case 'top': - if (dirtyX) { - if (diff === 0) { + if (dirty.dirtyX) { + if (diff <= 1) { lines.x.push(t); } } else { lines.x.push(t); diffY = t - top; - dirtyX = true; + dirty.dirtyX = true; } break; case 'bottom': - if (dirtyX) { - if (diff === 0) { + if (dirty.dirtyX) { + if (diff <= 1) { lines.x.push(t + h); } } else { lines.x.push(t + h); - diffY = (t + h - top - height) / 2; - dirtyX = true; + diffY = t + h - top - height; + dirty.dirtyX = true; } break; case 't-b': - if (dirtyX) { - if (diff === 0) { + if (dirty.dirtyX) { + if (diff <= 1) { lines.x.push(t + h); } } else { lines.x.push(t + h); - diffY = (t + h - top) / 2; - dirtyX = true; + diffY = t + h - top; + dirty.dirtyX = true; } break; case 'b-t': - if (dirtyX) { - if (diff === 0) { + if (dirty.dirtyX) { + if (diff <= 1) { lines.x.push(t); } } else { lines.x.push(t); diffY = t - (top + height); - dirtyX = true; + dirty.dirtyX = true; } break; } diff --git a/packages/dooringx-lib/src/index.less b/packages/dooringx-lib/src/index.less index fd22260..db979a8 100644 --- a/packages/dooringx-lib/src/index.less +++ b/packages/dooringx-lib/src/index.less @@ -206,8 +206,8 @@ } .rotatereset { position: absolute; - top: -35px; - left: calc(100% - 15px); + top: -20px; + left: calc(100% + 15px); cursor: pointer; font-size: 20px; color: gray; diff --git a/packages/dooringx-plugin-template/package.json b/packages/dooringx-plugin-template/package.json index 2d00b8f..95ae690 100644 --- a/packages/dooringx-plugin-template/package.json +++ b/packages/dooringx-plugin-template/package.json @@ -1,6 +1,6 @@ { "name": "dooringx-plugin-template", - "version": "0.11.4", + "version": "0.11.5", "description": "> TODO: description", "author": "yehuozhili <673632758@qq.com>", "homepage": "https://github.com/H5-Dooring/dooringx#readme", diff --git a/packages/dooringx-plugin-template/template/template.json b/packages/dooringx-plugin-template/template/template.json index 28ad377..c984c7b 100644 --- a/packages/dooringx-plugin-template/template/template.json +++ b/packages/dooringx-plugin-template/template/template.json @@ -40,7 +40,7 @@ "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@svgr/rollup": "^5.5.0", - "dooringx-lib": "^0.11.4", + "dooringx-lib": "^0.11.5", "postcss": "^8.3.6", "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-postcss": "^4.0.1",