fix(image-annotate): v1.8.3 图层不透明度滑杆可拖动、图层拖动排序真正生效
- 去掉图层项的 HTML5 draggable(它会把子元素的原生拖动一起接管, 滑杆因此只能点不能拖) - 排序改为指针拖动:越过行中线就实时插位,松手读 DOM 顺序落地, 修掉「向下拖一格索引回退等于原地不动」 - 拖动中整行浮起、其余行让位;原图固定最底层;滑块拖动像素实时跟随 - blur 兜底必须判 e.target === window,否则子元素失焦会取消拖动 - harness 新增 6 项(真实鼠标拖滑杆 / 换位与 z / 拖到最底 / 位移不足算点击 / 焦点在工具栏时也能拖 / 位图与矢量混排),共 146 项
This commit is contained in:
1 parent
6e1685998f
commit
040b08fe28
7 files changed
+547
-65
No files matched your search
@@ -751,6 +751,8 @@
|
||||
flex: 1 1 auto;
|
||||
overflow-y: auto;
|
||||
padding: 4px;
|
||||
/* 拖动排序的插入线是绝对定位的,锚点必须在列表上(随滚动一起移动) */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 图层项:整项改成「行 + 可选的不透明度行」,两行都靠 .iwb-layer-row 保持原来的横向排布 */
|
||||
@@ -758,7 +760,8 @@
|
||||
display: block;
|
||||
padding: 5px 8px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
cursor: grab;
|
||||
user-select: none;
|
||||
transition: background 0.12s;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
@@ -774,9 +777,18 @@
|
||||
box-shadow: inset 2px 0 0 #e8a735;
|
||||
}
|
||||
.iwb-layer-item.hidden { opacity: 0.5; }
|
||||
.iwb-layer-item[draggable="true"] { cursor: grab; }
|
||||
.iwb-layer-item.dragging { opacity: 0.45; }
|
||||
.iwb-layer-item.drop-target { outline: 1px dashed #e8a735; background: rgba(232, 167, 53, 0.16); }
|
||||
/* 拖动中:整行跟着指针浮起,压住相邻行;其余行由 JS 实时让位(落点反馈) */
|
||||
.iwb-layer-item.dragging {
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
opacity: 1;
|
||||
background: #3a3d55;
|
||||
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), inset 0 0 0 1px #e8a735;
|
||||
transition: none;
|
||||
cursor: grabbing;
|
||||
}
|
||||
.iwb-editor-layer-list.sorting,
|
||||
.iwb-editor-layer-list.sorting .iwb-layer-item { cursor: grabbing; }
|
||||
/* 画笔/橡皮作用目标:与「选中」分离,避免出现两个图层同时高亮 */
|
||||
.iwb-layer-paint { flex: 0 0 auto; color: #a6adc8; font-size: 11px; opacity: 0.85; }
|
||||
/* 不透明度角标:只有非 100% 才出现,一眼看出哪层被调淡了 */
|
||||
|
||||
Reference in new issue
Block a user