刻度尺高亮,前景虚化
This commit is contained in:
1 parent
f040f82b51
commit
2bf38dece2
6 files changed
+60
-18
No files matched your search
@@ -219,6 +219,14 @@ textarea[disabled] {
|
||||
color: black;
|
||||
}
|
||||
|
||||
table.col td.highlight {
|
||||
background-color: #77ddcc;
|
||||
}
|
||||
|
||||
table.row td.highlight {
|
||||
background-color: #88bbdd;
|
||||
}
|
||||
|
||||
/** ======== blockly 相关 ======== */
|
||||
|
||||
/*魔改*/
|
||||
|
||||
@@ -321,6 +321,14 @@ option:checked {
|
||||
color: #bbbbbb;
|
||||
}
|
||||
|
||||
table.col td.highlight {
|
||||
background-color: #66ccbb;
|
||||
}
|
||||
|
||||
table.row td.highlight {
|
||||
background-color: #77aacc;
|
||||
}
|
||||
|
||||
/** ======== blockly 相关 ======== */
|
||||
|
||||
/**
|
||||
|
||||
@@ -59,6 +59,8 @@ function editor() {
|
||||
undoFloor: document.getElementById('undoFloor'),
|
||||
editorTheme: document.getElementById('editorTheme'),
|
||||
bigmapBtn : document.getElementById('bigmapBtn'),
|
||||
mapRowMark: document.getElementById('mapRowMark'),
|
||||
mapColMark: document.getElementById('mapColMark'),
|
||||
maps: ['bgmap', 'fgmap', 'map'],
|
||||
canvas: ['bg', 'fg'],
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@ editor_listen_wrapper = function (editor) {
|
||||
editor.dom.eui.onmousedown = editor.uifunctions.map_ondown
|
||||
editor.dom.eui.onmousemove = editor.uifunctions.map_onmove
|
||||
editor.dom.eui.onmouseup = editor.uifunctions.map_onup
|
||||
editor.dom.eui.onmouseout = editor.uifunctions.map_onmoveout
|
||||
|
||||
editor.dom.mid.onmousewheel = editor.uifunctions.map_mousewheel
|
||||
|
||||
|
||||
@@ -138,6 +138,18 @@ editor_mappanel_wrapper = function (editor) {
|
||||
}
|
||||
}
|
||||
|
||||
var _setMarksHightlight = function (marks, index) {
|
||||
for (var i = 0; i < marks.length; ++i) {
|
||||
if (marks[i].classList.contains('highlight')) {
|
||||
if (i == index) index = null;
|
||||
else marks[i].classList.remove('highlight');
|
||||
}
|
||||
}
|
||||
if (index != null) {
|
||||
marks[index].classList.add('highlight');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* editor.dom.eui.onmousemove
|
||||
* + 非绘图模式时维护起止位置并画箭头
|
||||
@@ -145,6 +157,13 @@ editor_mappanel_wrapper = function (editor) {
|
||||
*/
|
||||
editor.uifunctions.map_onmove = function (e) {
|
||||
editor.uivalues.lastMoveE=e;
|
||||
if (!editor.uivalues.bigmap && !editor.isMobile) {
|
||||
var loc = editor.uifunctions.eToLoc(e);
|
||||
var pos = editor.uifunctions.locToPos(loc);
|
||||
_setMarksHightlight(Array.from(editor.dom.mapColMark.children[0].rows[0].cells), pos.x);
|
||||
_setMarksHightlight(Array.from(editor.dom.mapRowMark.children[0].rows).map(function (tr) {return tr.cells[0];}), pos.y);
|
||||
}
|
||||
|
||||
if (!selectBox.isSelected()) {
|
||||
if (editor.uivalues.startPos == null) return;
|
||||
var loc = editor.uifunctions.eToLoc(e);
|
||||
@@ -225,6 +244,13 @@ editor_mappanel_wrapper = function (editor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
editor.uifunctions.map_onmoveout = function () {
|
||||
if (!editor.uivalues.bigmap && !editor.isMobile) {
|
||||
_setMarksHightlight(Array.from(editor.dom.mapColMark.children[0].rows[0].cells));
|
||||
_setMarksHightlight(Array.from(editor.dom.mapRowMark.children[0].rows).map(function (tr) {return tr.cells[0];}));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* editor.dom.eui.onmouseup
|
||||
* + 非绘图模式时, 交换首末点的内容
|
||||
|
||||
Reference in new issue
Block a user