update 0.11.5

This commit is contained in:
hufeixiong
2022-01-06 12:25:30 +08:00
parent 733883c721
commit 12ab2e813b
9 changed files with 46 additions and 33 deletions

View File

@@ -1,4 +1,10 @@
## 0.11.5
修复参考线吸附与错误位移bug
修改旋转回正的位置
## 0.11.4 ## 0.11.4
修复参考线bug 修复参考线bug

View File

@@ -5,6 +5,9 @@ nav:
title: change log title: change log
order: 6 order: 6
--- ---
## 0.11.5
Fix reference line adsorption and wrong displacement bug
Change the position of the rotation justification
## 0.11.4 ## 0.11.4
Fix guide line bug Fix guide line bug
Optimized drag and drop algorithm Optimized drag and drop algorithm

View File

@@ -6,6 +6,12 @@ nav:
order: 6 order: 6
--- ---
## 0.11.5
修复参考线吸附与错误位移bug
修改旋转回正的位置
## 0.11.4 ## 0.11.4
修复参考线bug 修复参考线bug

View File

@@ -1,5 +1,5 @@
{ {
"version": "0.11.4", "version": "0.11.5",
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "dist/index.js",
"module": "dist/dooringx-lib.esm.js", "module": "dist/dooringx-lib.esm.js",

View File

@@ -176,7 +176,6 @@ export function marklineCalRender(config: UserConfig, iframe: boolean): LinesTyp
'r-l' 'r-l'
); );
} }
const indexTopBottom = binarySearchRemain<RealStyleType>( const indexTopBottom = binarySearchRemain<RealStyleType>(
realStyle.top, realStyle.top,
marklineState.sortBottom, marklineState.sortBottom,

View File

@@ -32,97 +32,96 @@ export function marklineDisplay(
direction: 'left' | 'top' | 'bottom' | 'right' | 't-b' | 'b-t' | 'l-r' | 'r-l' direction: 'left' | 'top' | 'bottom' | 'right' | 't-b' | 'b-t' | 'l-r' | 'r-l'
) { ) {
const { top, height, left, width } = focusStyle; const { top, height, left, width } = focusStyle;
let { dirtyX, dirtyY } = dirty;
const { top: t, height: h, left: l, width: w } = unFocusStyle; const { top: t, height: h, left: l, width: w } = unFocusStyle;
let diffY = 0; let diffY = 0;
let diffX = 0; let diffX = 0;
switch (direction) { switch (direction) {
case 'left': case 'left':
if (dirtyY) { if (dirty.dirtyY) {
if (diff === 0) { if (diff <= 1) {
lines.y.push(l); lines.y.push(l);
} }
} else { } else {
lines.y.push(l); lines.y.push(l);
diffX = l - left; diffX = l - left;
dirtyY = true; dirty.dirtyY = true;
} }
break; break;
case 'right': case 'right':
if (dirtyY) { if (dirty.dirtyY) {
if (diff === 0) { if (diff <= 1) {
lines.y.push(l + w); lines.y.push(l + w);
} }
} else { } else {
lines.y.push(l + w); lines.y.push(l + w);
diffX = l + w - left - width; diffX = l + w - left - width;
dirtyY = true; dirty.dirtyY = true;
} }
break; break;
case 'l-r': case 'l-r':
if (dirtyY) { if (dirty.dirtyY) {
if (diff === 0) { if (diff <= 1) {
lines.y.push(l + w); lines.y.push(l + w);
} }
} else { } else {
lines.y.push(l + w); lines.y.push(l + w);
diffX = l + w - left; diffX = l + w - left;
dirtyY = true; dirty.dirtyY = true;
} }
break; break;
case 'r-l': case 'r-l':
if (dirtyY) { if (dirty.dirtyY) {
if (diff === 0) { if (diff <= 1) {
lines.y.push(l); lines.y.push(l);
} }
} else { } else {
lines.y.push(l); lines.y.push(l);
diffX = l - (left + width); diffX = l - (left + width);
dirtyY = true; dirty.dirtyY = true;
} }
break; break;
case 'top': case 'top':
if (dirtyX) { if (dirty.dirtyX) {
if (diff === 0) { if (diff <= 1) {
lines.x.push(t); lines.x.push(t);
} }
} else { } else {
lines.x.push(t); lines.x.push(t);
diffY = t - top; diffY = t - top;
dirtyX = true; dirty.dirtyX = true;
} }
break; break;
case 'bottom': case 'bottom':
if (dirtyX) { if (dirty.dirtyX) {
if (diff === 0) { if (diff <= 1) {
lines.x.push(t + h); lines.x.push(t + h);
} }
} else { } else {
lines.x.push(t + h); lines.x.push(t + h);
diffY = (t + h - top - height) / 2; diffY = t + h - top - height;
dirtyX = true; dirty.dirtyX = true;
} }
break; break;
case 't-b': case 't-b':
if (dirtyX) { if (dirty.dirtyX) {
if (diff === 0) { if (diff <= 1) {
lines.x.push(t + h); lines.x.push(t + h);
} }
} else { } else {
lines.x.push(t + h); lines.x.push(t + h);
diffY = (t + h - top) / 2; diffY = t + h - top;
dirtyX = true; dirty.dirtyX = true;
} }
break; break;
case 'b-t': case 'b-t':
if (dirtyX) { if (dirty.dirtyX) {
if (diff === 0) { if (diff <= 1) {
lines.x.push(t); lines.x.push(t);
} }
} else { } else {
lines.x.push(t); lines.x.push(t);
diffY = t - (top + height); diffY = t - (top + height);
dirtyX = true; dirty.dirtyX = true;
} }
break; break;
} }

View File

@@ -206,8 +206,8 @@
} }
.rotatereset { .rotatereset {
position: absolute; position: absolute;
top: -35px; top: -20px;
left: calc(100% - 15px); left: calc(100% + 15px);
cursor: pointer; cursor: pointer;
font-size: 20px; font-size: 20px;
color: gray; color: gray;

View File

@@ -1,6 +1,6 @@
{ {
"name": "dooringx-plugin-template", "name": "dooringx-plugin-template",
"version": "0.11.4", "version": "0.11.5",
"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",

View File

@@ -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.4", "dooringx-lib": "^0.11.5",
"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",