update 0.11.7
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
## 0.11.7
|
||||||
|
|
||||||
|
取消多选吸附功能。
|
||||||
## 0.11.6
|
## 0.11.6
|
||||||
|
|
||||||
取消第一次点击鼠标的吸附。
|
取消第一次点击鼠标的吸附。
|
||||||
|
@@ -5,6 +5,8 @@ nav:
|
|||||||
title: change log
|
title: change log
|
||||||
order: 6
|
order: 6
|
||||||
---
|
---
|
||||||
|
## 0.11.7
|
||||||
|
Cancel the multi selection adsorption function.
|
||||||
## 0.11.6
|
## 0.11.6
|
||||||
Cancel the first mouse click.
|
Cancel the first mouse click.
|
||||||
Modify the selected color of timeline.
|
Modify the selected color of timeline.
|
||||||
|
@@ -5,6 +5,9 @@ nav:
|
|||||||
title: 变更日志
|
title: 变更日志
|
||||||
order: 6
|
order: 6
|
||||||
---
|
---
|
||||||
|
## 0.11.7
|
||||||
|
|
||||||
|
取消多选吸附功能。
|
||||||
## 0.11.6
|
## 0.11.6
|
||||||
|
|
||||||
取消第一次点击鼠标的吸附。
|
取消第一次点击鼠标的吸附。
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.11.6",
|
"version": "0.11.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "dist/dooringx-lib.esm.js",
|
"module": "dist/dooringx-lib.esm.js",
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* @Author: yehuozhili
|
* @Author: yehuozhili
|
||||||
* @Date: 2021-03-14 04:29:09
|
* @Date: 2021-03-14 04:29:09
|
||||||
* @LastEditors: yehuozhili
|
* @LastEditors: yehuozhili
|
||||||
* @LastEditTime: 2021-12-31 00:25:43
|
* @LastEditTime: 2022-01-12 09:15:44
|
||||||
* @FilePath: \dooringx\packages\dooringx-lib\src\core\markline\calcRender.ts
|
* @FilePath: \dooringx\packages\dooringx-lib\src\core\markline\calcRender.ts
|
||||||
*/
|
*/
|
||||||
import { innerDragState } from '../innerDrag/state';
|
import { innerDragState } from '../innerDrag/state';
|
||||||
@@ -105,137 +105,140 @@ export function marklineCalRender(config: UserConfig, iframe: boolean): LinesTyp
|
|||||||
|
|
||||||
// 只要cache里有东西,说明有缓存
|
// 只要cache里有东西,说明有缓存
|
||||||
if (marklineState.cache) {
|
if (marklineState.cache) {
|
||||||
if (!marklineState.sortLeft) {
|
const focusItem = config.getFocusState();
|
||||||
marklineState.sortLeft = Object.values(marklineState.cache).sort((a, b) => {
|
const isMulti = focusItem.blocks.length > 1;
|
||||||
return a.left - b.left;
|
if (!isMulti) {
|
||||||
});
|
if (!marklineState.sortLeft) {
|
||||||
}
|
marklineState.sortLeft = Object.values(marklineState.cache).sort((a, b) => {
|
||||||
if (!marklineState.sortTop) {
|
return a.left - b.left;
|
||||||
marklineState.sortTop = Object.values(marklineState.cache).sort((a, b) => {
|
});
|
||||||
return a.top - b.top;
|
}
|
||||||
});
|
if (!marklineState.sortTop) {
|
||||||
}
|
marklineState.sortTop = Object.values(marklineState.cache).sort((a, b) => {
|
||||||
if (!marklineState.sortBottom) {
|
return a.top - b.top;
|
||||||
marklineState.sortBottom = Object.values(marklineState.cache).sort((a, b) => {
|
});
|
||||||
return a.bottom - b.bottom;
|
}
|
||||||
});
|
if (!marklineState.sortBottom) {
|
||||||
}
|
marklineState.sortBottom = Object.values(marklineState.cache).sort((a, b) => {
|
||||||
if (!marklineState.sortRight) {
|
return a.bottom - b.bottom;
|
||||||
marklineState.sortRight = Object.values(marklineState.cache).sort((a, b) => {
|
});
|
||||||
return a.right - b.right;
|
}
|
||||||
});
|
if (!marklineState.sortRight) {
|
||||||
}
|
marklineState.sortRight = Object.values(marklineState.cache).sort((a, b) => {
|
||||||
// 划线的元素不应该冲突
|
return a.right - b.right;
|
||||||
// 当横向或者纵向已经吸附过,则后续不进行吸附,差值为0则划线。
|
});
|
||||||
// 未吸附过时的第一次划线会带吸附,后续按上述走
|
}
|
||||||
const dirty = {
|
// 划线的元素不应该冲突
|
||||||
dirtyX: false,
|
// 当横向或者纵向已经吸附过,则后续不进行吸附,差值为0则划线。
|
||||||
dirtyY: false,
|
// 未吸附过时的第一次划线会带吸附,后续按上述走
|
||||||
};
|
const dirty = {
|
||||||
const indexLeft = binarySearchRemain<RealStyleType>(
|
dirtyX: false,
|
||||||
realStyle.left,
|
dirtyY: false,
|
||||||
marklineState.sortLeft,
|
};
|
||||||
'left',
|
const indexLeft = binarySearchRemain<RealStyleType>(
|
||||||
marklineConfig.indent
|
realStyle.left,
|
||||||
);
|
marklineState.sortLeft,
|
||||||
if (indexLeft) {
|
'left',
|
||||||
marklineDisplay(realStyle, indexLeft[0], lines, focus, indexLeft[1], dirty, 'left');
|
marklineConfig.indent
|
||||||
}
|
|
||||||
|
|
||||||
const indexLeftRight = binarySearchRemain<RealStyleType>(
|
|
||||||
realStyle.left,
|
|
||||||
marklineState.sortRight,
|
|
||||||
'right',
|
|
||||||
marklineConfig.indent
|
|
||||||
);
|
|
||||||
if (indexLeftRight) {
|
|
||||||
marklineDisplay(
|
|
||||||
realStyle,
|
|
||||||
indexLeftRight[0],
|
|
||||||
lines,
|
|
||||||
focus,
|
|
||||||
indexLeftRight[1],
|
|
||||||
dirty,
|
|
||||||
'l-r'
|
|
||||||
);
|
);
|
||||||
}
|
if (indexLeft) {
|
||||||
const indexRightLeft = binarySearchRemain<RealStyleType>(
|
marklineDisplay(realStyle, indexLeft[0], lines, focus, indexLeft[1], dirty, 'left');
|
||||||
realStyle.right,
|
}
|
||||||
marklineState.sortLeft,
|
const indexLeftRight = binarySearchRemain<RealStyleType>(
|
||||||
'left',
|
realStyle.left,
|
||||||
marklineConfig.indent
|
marklineState.sortRight,
|
||||||
);
|
'right',
|
||||||
if (indexRightLeft) {
|
marklineConfig.indent
|
||||||
marklineDisplay(
|
|
||||||
realStyle,
|
|
||||||
indexRightLeft[0],
|
|
||||||
lines,
|
|
||||||
focus,
|
|
||||||
indexRightLeft[1],
|
|
||||||
dirty,
|
|
||||||
'r-l'
|
|
||||||
);
|
);
|
||||||
}
|
if (indexLeftRight) {
|
||||||
const indexTopBottom = binarySearchRemain<RealStyleType>(
|
marklineDisplay(
|
||||||
realStyle.top,
|
realStyle,
|
||||||
marklineState.sortBottom,
|
indexLeftRight[0],
|
||||||
'bottom',
|
lines,
|
||||||
marklineConfig.indent
|
focus,
|
||||||
);
|
indexLeftRight[1],
|
||||||
if (indexTopBottom) {
|
dirty,
|
||||||
marklineDisplay(
|
'l-r'
|
||||||
realStyle,
|
);
|
||||||
indexTopBottom[0],
|
}
|
||||||
lines,
|
const indexRightLeft = binarySearchRemain<RealStyleType>(
|
||||||
focus,
|
realStyle.right,
|
||||||
indexTopBottom[1],
|
marklineState.sortLeft,
|
||||||
dirty,
|
'left',
|
||||||
't-b'
|
marklineConfig.indent
|
||||||
);
|
);
|
||||||
}
|
if (indexRightLeft) {
|
||||||
const indexBottomTop = binarySearchRemain<RealStyleType>(
|
marklineDisplay(
|
||||||
realStyle.bottom,
|
realStyle,
|
||||||
marklineState.sortTop,
|
indexRightLeft[0],
|
||||||
'top',
|
lines,
|
||||||
marklineConfig.indent
|
focus,
|
||||||
);
|
indexRightLeft[1],
|
||||||
if (indexBottomTop) {
|
dirty,
|
||||||
marklineDisplay(
|
'r-l'
|
||||||
realStyle,
|
);
|
||||||
indexBottomTop[0],
|
}
|
||||||
lines,
|
const indexTopBottom = binarySearchRemain<RealStyleType>(
|
||||||
focus,
|
realStyle.top,
|
||||||
indexBottomTop[1],
|
marklineState.sortBottom,
|
||||||
dirty,
|
'bottom',
|
||||||
'b-t'
|
marklineConfig.indent
|
||||||
);
|
);
|
||||||
}
|
if (indexTopBottom) {
|
||||||
const indexTop = binarySearchRemain<RealStyleType>(
|
marklineDisplay(
|
||||||
realStyle.top,
|
realStyle,
|
||||||
marklineState.sortTop,
|
indexTopBottom[0],
|
||||||
'top',
|
lines,
|
||||||
marklineConfig.indent
|
focus,
|
||||||
);
|
indexTopBottom[1],
|
||||||
if (indexTop) {
|
dirty,
|
||||||
marklineDisplay(realStyle, indexTop[0], lines, focus, indexTop[1], dirty, 'top');
|
't-b'
|
||||||
}
|
);
|
||||||
const indexRight = binarySearchRemain<RealStyleType>(
|
}
|
||||||
realStyle.right,
|
const indexBottomTop = binarySearchRemain<RealStyleType>(
|
||||||
marklineState.sortRight,
|
realStyle.bottom,
|
||||||
'right',
|
marklineState.sortTop,
|
||||||
marklineConfig.indent
|
'top',
|
||||||
);
|
marklineConfig.indent
|
||||||
if (indexRight) {
|
);
|
||||||
marklineDisplay(realStyle, indexRight[0], lines, focus, indexRight[1], dirty, 'right');
|
if (indexBottomTop) {
|
||||||
}
|
marklineDisplay(
|
||||||
const indexBottom = binarySearchRemain<RealStyleType>(
|
realStyle,
|
||||||
realStyle.bottom,
|
indexBottomTop[0],
|
||||||
marklineState.sortBottom,
|
lines,
|
||||||
'bottom',
|
focus,
|
||||||
marklineConfig.indent
|
indexBottomTop[1],
|
||||||
);
|
dirty,
|
||||||
if (indexBottom) {
|
'b-t'
|
||||||
marklineDisplay(realStyle, indexBottom[0], lines, focus, indexBottom[1], dirty, 'bottom');
|
);
|
||||||
|
}
|
||||||
|
const indexTop = binarySearchRemain<RealStyleType>(
|
||||||
|
realStyle.top,
|
||||||
|
marklineState.sortTop,
|
||||||
|
'top',
|
||||||
|
marklineConfig.indent
|
||||||
|
);
|
||||||
|
if (indexTop) {
|
||||||
|
marklineDisplay(realStyle, indexTop[0], lines, focus, indexTop[1], dirty, 'top');
|
||||||
|
}
|
||||||
|
const indexRight = binarySearchRemain<RealStyleType>(
|
||||||
|
realStyle.right,
|
||||||
|
marklineState.sortRight,
|
||||||
|
'right',
|
||||||
|
marklineConfig.indent
|
||||||
|
);
|
||||||
|
if (indexRight) {
|
||||||
|
marklineDisplay(realStyle, indexRight[0], lines, focus, indexRight[1], dirty, 'right');
|
||||||
|
}
|
||||||
|
const indexBottom = binarySearchRemain<RealStyleType>(
|
||||||
|
realStyle.bottom,
|
||||||
|
marklineState.sortBottom,
|
||||||
|
'bottom',
|
||||||
|
marklineConfig.indent
|
||||||
|
);
|
||||||
|
if (indexBottom) {
|
||||||
|
marklineDisplay(realStyle, indexBottom[0], lines, focus, indexBottom[1], dirty, 'bottom');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dooringx-plugin-template",
|
"name": "dooringx-plugin-template",
|
||||||
"version": "0.11.6",
|
"version": "0.11.7",
|
||||||
"description": "> TODO: description",
|
"description": "> TODO: description",
|
||||||
"author": "yehuozhili <673632758@qq.com>",
|
"author": "yehuozhili <673632758@qq.com>",
|
||||||
"homepage": "https://github.com/H5-Dooring/dooringx#readme",
|
"homepage": "https://github.com/H5-Dooring/dooringx#readme",
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
"@rollup/plugin-node-resolve": "^13.0.4",
|
"@rollup/plugin-node-resolve": "^13.0.4",
|
||||||
"@rollup/plugin-url": "^6.1.0",
|
"@rollup/plugin-url": "^6.1.0",
|
||||||
"@svgr/rollup": "^5.5.0",
|
"@svgr/rollup": "^5.5.0",
|
||||||
"dooringx-lib": "^0.11.6",
|
"dooringx-lib": "^0.11.7",
|
||||||
"postcss": "^8.3.6",
|
"postcss": "^8.3.6",
|
||||||
"rollup-plugin-peer-deps-external": "^2.2.4",
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
||||||
"rollup-plugin-postcss": "^4.0.1",
|
"rollup-plugin-postcss": "^4.0.1",
|
||||||
|
Reference in New Issue
Block a user