feat:【mall】diy editor 的 magic-cube-editor 优化
This commit is contained in:
@@ -259,6 +259,11 @@ const eachCube = (callback: (x: number, y: number, cube: Cube) => void) => {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: 1px solid var(--el-border-color);
|
border: 1px solid var(--el-border-color);
|
||||||
|
line-height: 1;
|
||||||
|
|
||||||
|
:deep(.iconify) {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
background: var(--el-color-primary-light-9);
|
background: var(--el-color-primary-light-9);
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ export function isContains(hotArea: Rect, point: Point): boolean {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO @AI:linter 修复
|
|
||||||
/**
|
/**
|
||||||
* 在两个坐标点中间,创建一个矩形
|
* 在两个坐标点中间,创建一个矩形
|
||||||
*
|
*
|
||||||
@@ -58,8 +57,12 @@ export function isContains(hotArea: Rect, point: Point): boolean {
|
|||||||
*/
|
*/
|
||||||
export function createRect(a: Point, b: Point): Rect {
|
export function createRect(a: Point, b: Point): Rect {
|
||||||
// 计算矩形的范围
|
// 计算矩形的范围
|
||||||
const [left, left2] = [a.x, b.x].sort();
|
let [left, left2] = [a.x, b.x].sort();
|
||||||
const [top, top2] = [a.y, b.y].sort();
|
left = left ?? 0;
|
||||||
|
left2 = left2 ?? 0;
|
||||||
|
let [top, top2] = [a.y, b.y].sort();
|
||||||
|
top = top ?? 0;
|
||||||
|
top2 = top2 ?? 0;
|
||||||
const right = left2 + 1;
|
const right = left2 + 1;
|
||||||
const bottom = top2 + 1;
|
const bottom = top2 + 1;
|
||||||
const height = bottom - top;
|
const height = bottom - top;
|
||||||
|
|||||||
Reference in New Issue
Block a user