|
@@ -389,11 +389,17 @@ const SpreadJsObj = {
|
|
|
sheet.getRange(-1, col, -1, 1).cellType(sheet.extendCellType.image);
|
|
|
}
|
|
|
if (colSetting.cellType === 'imageBtn') {
|
|
|
- if (!sheet.extendCellType.image) {
|
|
|
+ if (!sheet.extendCellType.imageBtn) {
|
|
|
sheet.extendCellType.imageBtn = this.CellType.getImageButtonCellType();
|
|
|
}
|
|
|
sheet.getRange(-1, col, -1, 1).cellType(sheet.extendCellType.imageBtn);
|
|
|
}
|
|
|
+ if (colSetting.cellType === 'activeImageBtn') {
|
|
|
+ if (!sheet.extendCellType.activeImageBtn) {
|
|
|
+ sheet.extendCellType.activeImageBtn = this.CellType.getActiveImageButtonCellType();
|
|
|
+ }
|
|
|
+ sheet.getRange(-1, col, -1, 1).cellType(sheet.extendCellType.activeImageBtn);
|
|
|
+ }
|
|
|
if (colSetting.cellType === 'tree') {
|
|
|
if (!sheet.extendCellType.tree) {
|
|
|
sheet.extendCellType.tree = this.CellType.getTreeNodeCellType();
|
|
@@ -1177,7 +1183,7 @@ const SpreadJsObj = {
|
|
|
AutoTipCellType.prototype = SpreadJsObj.CellType.getTipCellType();
|
|
|
const proto = AutoTipCellType.prototype
|
|
|
proto.showTip = function (hitinfo, text) {
|
|
|
- return text && text !== '' && this.getTextDisplayWidth(hitinfo, text) > hitinfo.cellRect.width;
|
|
|
+ return text && text !== '' && this.getTextDisplayWidth(hitinfo, text) > hitinfo.cellRect.widthidth;
|
|
|
};
|
|
|
|
|
|
return new AutoTipCellType();
|
|
@@ -1377,10 +1383,6 @@ const SpreadJsObj = {
|
|
|
sheetArea: context.sheetArea
|
|
|
};
|
|
|
};
|
|
|
- /**
|
|
|
- * 鼠标点击
|
|
|
- * @param {Object} hitinfo - 见getHitInfo
|
|
|
- */
|
|
|
proto.processMouseEnter = function (hitinfo) {
|
|
|
const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
// Drawing Image
|
|
@@ -1393,15 +1395,49 @@ const SpreadJsObj = {
|
|
|
proto.processMouseLeave = function (hitinfo) {
|
|
|
const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
// Drawing Image
|
|
|
- if (col.hoverImg) {
|
|
|
- const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
- cell.tag(null);
|
|
|
- hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
- }
|
|
|
+ const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
+ cell.tag(null);
|
|
|
+ hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
};
|
|
|
+ // proto.processMouseDown = function (hitinfo) {
|
|
|
+ // const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+ // if (col.activeImg) {
|
|
|
+ // const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
+ // cell.tag(active);
|
|
|
+ // hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // proto.processMouseUp = function (hitinfo) {
|
|
|
+ // const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+ // const sortData = SpreadJsObj.getSortData(hitinfo.sheet);
|
|
|
+ // const data = sortData ? sortData[hitinfo.row] : null;
|
|
|
+ // if (col.showImage && Object.prototype.toString.apply(col.showImage) === "[object Function]") {
|
|
|
+ // if (!col.showImage(data)) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // const imageClick = hitinfo.sheet.zh_setting ? hitinfo.sheet.zh_setting.imageClick : null;
|
|
|
+ // if (imageClick && Object.prototype.toString.apply(imageClick) === "[object Function]") {
|
|
|
+ // imageClick(data);
|
|
|
+ // const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
+ // cell.tag(null);
|
|
|
+ // hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ /*
|
|
|
+ 注释部分以进入鼠标进入图片,点击图片为基准更新图片,鼠标快速移动时,可能失效
|
|
|
+ */
|
|
|
proto.processMouseDown = function (hitinfo) {
|
|
|
const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
- if (col.activeImg) {
|
|
|
+ const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
+ const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
+ const indent = col.indent ? col.indent : 10;
|
|
|
+ const centerX = hitinfo.cellStyle.hAlign === spreadNS.HorizontalAlign.right
|
|
|
+ ? hitinfo.cellRect.x + hitinfo.cellRect.width - indent -halfX
|
|
|
+ : hitinfo.cellRect.x + indent + halfX;
|
|
|
+ const centerY = hitinfo.cellRect.y + hitinfo.cellRect.height / 2;
|
|
|
+
|
|
|
+ if (Math.abs(hitinfo.x - centerX) < halfX && Math.abs(hitinfo.y - centerY) < halfY) {
|
|
|
const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
cell.tag(active);
|
|
|
hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
@@ -1409,73 +1445,243 @@ const SpreadJsObj = {
|
|
|
};
|
|
|
proto.processMouseUp = function (hitinfo) {
|
|
|
const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
- const sortData = SpreadJsObj.getSortData(hitinfo.sheet);
|
|
|
- const data = sortData ? sortData[hitinfo.row] : null;
|
|
|
+ const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
+ const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
+ const indent = col.indent ? col.indent : 10;
|
|
|
+ const centerX = hitinfo.cellStyle.hAlign === spreadNS.HorizontalAlign.right
|
|
|
+ ? hitinfo.cellRect.x + hitinfo.cellRect.width - indent -halfX
|
|
|
+ : hitinfo.cellRect.x + indent + halfX;
|
|
|
+ const centerY = hitinfo.cellRect.y + hitinfo.cellRect.height / 2;
|
|
|
+
|
|
|
+ if (Math.abs(hitinfo.x - centerX) < halfX && Math.abs(hitinfo.y - centerY) < halfY) {
|
|
|
+ const imageClick = hitinfo.sheet.zh_setting ? hitinfo.sheet.zh_setting.imageClick : null;
|
|
|
+ if (imageClick && Object.prototype.toString.apply(imageClick) === "[object Function]") {
|
|
|
+ const sortData = SpreadJsObj.getSortData(hitinfo.sheet);
|
|
|
+ const data = sortData ? sortData[hitinfo.row] : null;
|
|
|
+ imageClick(data);
|
|
|
+ const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
+ cell.tag(null);
|
|
|
+ hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ proto.processMouseMove = function (hitinfo) {
|
|
|
+ const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+ const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
+ const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
+ const indent = col.indent ? col.indent : 10;
|
|
|
+ const centerX = hitinfo.cellStyle.hAlign === spreadNS.HorizontalAlign.right
|
|
|
+ ? hitinfo.cellRect.x + hitinfo.cellRect.width - indent -halfX
|
|
|
+ : hitinfo.cellRect.x + indent + halfX;
|
|
|
+ const centerY = hitinfo.cellRect.y + hitinfo.cellRect.height / 2;
|
|
|
+ const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
+ if (Math.abs(hitinfo.x - centerX) < halfX && Math.abs(hitinfo.y - centerY) < halfY) {
|
|
|
+ if (cell.tag() !== hover) {
|
|
|
+ cell.tag(hover);
|
|
|
+ hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (cell.tag() === hover) {
|
|
|
+ cell.tag(null);
|
|
|
+ hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return new ImageCellType();
|
|
|
+ },
|
|
|
+ getActiveImageButtonCellType: function () {
|
|
|
+ let show = 1, hover = 2, active = 2;
|
|
|
+ const ImageCellType = function (){};
|
|
|
+ ImageCellType.prototype = new spreadNS.CellTypes.Text();
|
|
|
+ const proto = ImageCellType.prototype;
|
|
|
+ proto.getImage = function (sheet, iRow, iCol) {
|
|
|
+ const col = sheet.zh_setting.cols[iCol];
|
|
|
+ let imgSource = null;
|
|
|
+ const cell = sheet.getCell(iRow, iCol), tag = cell.tag();
|
|
|
+ if (tag === show) {
|
|
|
+ imgSource = col.normalImg;
|
|
|
+ } else if (tag === active) {
|
|
|
+ imgSource = col.activeImg ? col.activeImg : (col.hoverImg ? col.hoverImg : col.normalImg);
|
|
|
+ } else if (tag === hover) {
|
|
|
+ imgSource = col.hoverImg ? col.hoverImg : col.normalImg;
|
|
|
+ }
|
|
|
+ if (imgSource && Object.prototype.toString.apply(imgSource) === "[object Function]") {
|
|
|
+ const sortData = SpreadJsObj.getSortData(sheet);
|
|
|
+ const data = sortData ? sortData[iRow] : null;
|
|
|
+ return data ? imgSource(data) : null;
|
|
|
+ } else {
|
|
|
+ return $(imgSource)[0] ? $(imgSource)[0] : null;
|
|
|
+ }
|
|
|
+
|
|
|
+ };
|
|
|
+ proto.paint = function (canvas, value, x, y, w, h, style, options) {
|
|
|
+ const col = options.sheet.zh_setting.cols[options.col];
|
|
|
+
|
|
|
+ const sortData = SpreadJsObj.getSortData(options.sheet);
|
|
|
+ const data = sortData ? sortData[options.row] : null;
|
|
|
+ let showImage = true;
|
|
|
if (col.showImage && Object.prototype.toString.apply(col.showImage) === "[object Function]") {
|
|
|
- if (!col.showImage(data)) {
|
|
|
- return;
|
|
|
+ showImage = col.showImage(data);
|
|
|
+ }
|
|
|
+ const img = showImage ? this.getImage(options.sheet, options.row, options.col) : null;
|
|
|
+
|
|
|
+ const indent = col.indent ? col.indent : 10;
|
|
|
+ if (style.hAlign === spreadNS.HorizontalAlign.right) {
|
|
|
+ if (img) {
|
|
|
+ if (style.backColor) {
|
|
|
+ canvas.save();
|
|
|
+ canvas.fillStyle = style.backColor;
|
|
|
+ canvas.fillRect(x + w - indent - img.width, y, img.width, h);
|
|
|
+ canvas.restore();
|
|
|
+ }
|
|
|
+ canvas.drawImage(img, x + w - indent - img.width, y + (h - img.height) / 2);
|
|
|
+ w = w - indent - img.width;
|
|
|
+ }
|
|
|
+ // Drawing Text
|
|
|
+ spreadNS.CellTypes.Text.prototype.paint.apply(this, [canvas, value, x, y, w, h, style, options]);
|
|
|
+ } else {
|
|
|
+ if (img) {
|
|
|
+ if (style.backColor) {
|
|
|
+ canvas.save();
|
|
|
+ canvas.fillStyle = style.backColor;
|
|
|
+ canvas.fillRect(x, y, indent + img.width, h);
|
|
|
+ canvas.restore();
|
|
|
+ }
|
|
|
+ canvas.drawImage(img, x + 10, y + (h - img.height) / 2);
|
|
|
+ if (style.hAlign !== spreadNS.HorizontalAlign.left) {
|
|
|
+ style.hAlign = spreadNS.HorizontalAlign.left;
|
|
|
+ }
|
|
|
+ x = x + indent + img.width;
|
|
|
+ w = w - indent - img.width;
|
|
|
}
|
|
|
+ // Drawing Text
|
|
|
+ spreadNS.CellTypes.Text.prototype.paint.apply(this, [canvas, value, x, y, w, h, style, options]);
|
|
|
}
|
|
|
- const imageClick = hitinfo.sheet.zh_setting ? hitinfo.sheet.zh_setting.imageClick : null;
|
|
|
- if (imageClick && Object.prototype.toString.apply(imageClick) === "[object Function]") {
|
|
|
- imageClick(data);
|
|
|
+
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * 获取点击信息
|
|
|
+ * @param {Number} x
|
|
|
+ * @param {Number} y
|
|
|
+ * @param {Object} cellStyle
|
|
|
+ * @param {Object} cellRect
|
|
|
+ * @param {Object} context
|
|
|
+ * @returns {{x: *, y: *, row: *, col: *|boolean|*[]|number|{}|UE.dom.dtd.col, cellStyle: *, cellRect: *, sheet: *|StyleSheet, sheetArea: *}}
|
|
|
+ */
|
|
|
+ proto.getHitInfo = function (x, y, cellStyle, cellRect, context) {
|
|
|
+ return {
|
|
|
+ x: x,
|
|
|
+ y: y,
|
|
|
+ row: context.row,
|
|
|
+ col: context.col,
|
|
|
+ cellStyle: cellStyle,
|
|
|
+ cellRect: cellRect,
|
|
|
+ sheet: context.sheet,
|
|
|
+ sheetArea: context.sheetArea
|
|
|
+ };
|
|
|
+ };
|
|
|
+ proto.processMouseEnter = function (hitinfo) {
|
|
|
+ const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+ // Drawing Image
|
|
|
+ if (col.normalImg) {
|
|
|
const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
- cell.tag(null);
|
|
|
+ cell.tag(show);
|
|
|
hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
}
|
|
|
};
|
|
|
- /*
|
|
|
- 注释部分以进入鼠标进入图片,点击图片为基准更新图片,鼠标快速移动时,可能失效
|
|
|
- */
|
|
|
+ proto.processMouseLeave = function (hitinfo) {
|
|
|
+ const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
+ cell.tag(null);
|
|
|
+ hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ };
|
|
|
// proto.processMouseDown = function (hitinfo) {
|
|
|
- // const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
- // const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
- // const centerX = hitinfo.cellRect.x + indent + halfX;
|
|
|
- // const centerY = hitinfo.cellRect.y + hitinfo.cellRect.height / 2;
|
|
|
- //
|
|
|
- // if (Math.abs(hitinfo.x - centerX) < halfX && Math.abs(hitinfo.y - centerY) < halfY) {
|
|
|
+ // const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+ // if (col.activeImg) {
|
|
|
// const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
- // cell.tag(down);
|
|
|
+ // cell.tag(active);
|
|
|
// hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
// }
|
|
|
// };
|
|
|
// proto.processMouseUp = function (hitinfo) {
|
|
|
- // const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
- // const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
- // const centerX = hitinfo.cellRect.x + indent + halfX;
|
|
|
- // const centerY = hitinfo.cellRect.y + hitinfo.cellRect.height / 2;
|
|
|
- //
|
|
|
- // // 点击展开节点时,如果已加载子项,则展开,反之这加载子项,展开
|
|
|
- // if (Math.abs(hitinfo.x - centerX) < halfX && Math.abs(hitinfo.y - centerY) < halfY) {
|
|
|
- // const imageClick = hitinfo.sheet.zh_setting ? hitinfo.sheet.zh_setting.imageClick : null;
|
|
|
- // if (imageClick && Object.prototype.toString.apply(imageClick) === "[object Function]") {
|
|
|
- // const sortData = SpreadJsObj.getSortData(hitinfo.sheet);
|
|
|
- // const data = sortData ? sortData[hitinfo.row] : null;
|
|
|
- // imageClick(data);
|
|
|
- // const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
- // cell.tag(null);
|
|
|
- // hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ // const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+ // const sortData = SpreadJsObj.getSortData(hitinfo.sheet);
|
|
|
+ // const data = sortData ? sortData[hitinfo.row] : null;
|
|
|
+ // if (col.showImage && Object.prototype.toString.apply(col.showImage) === "[object Function]") {
|
|
|
+ // if (!col.showImage(data)) {
|
|
|
+ // return;
|
|
|
// }
|
|
|
// }
|
|
|
- // };
|
|
|
- // proto.processMouseMove = function (hitinfo) {
|
|
|
- // const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
- // const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
- // const centerX = hitinfo.cellRect.x + indent + halfX;
|
|
|
- // const centerY = hitinfo.cellRect.y + hitinfo.cellRect.height / 2;
|
|
|
- // const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
- // if (Math.abs(hitinfo.x - centerX) < halfX && Math.abs(hitinfo.y - centerY) < halfY) {
|
|
|
- // if (cell.tag() !== hover) {
|
|
|
- // cell.tag(hover);
|
|
|
- // hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // if (cell.tag() === hover) {
|
|
|
- // cell.tag(null);
|
|
|
- // hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
- // }
|
|
|
+ // const imageClick = hitinfo.sheet.zh_setting ? hitinfo.sheet.zh_setting.imageClick : null;
|
|
|
+ // if (imageClick && Object.prototype.toString.apply(imageClick) === "[object Function]") {
|
|
|
+ // imageClick(data);
|
|
|
+ // const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
+ // cell.tag(null);
|
|
|
+ // hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
// }
|
|
|
// };
|
|
|
+ /*
|
|
|
+ 注释部分以进入鼠标进入图片,点击图片为基准更新图片,鼠标快速移动时,可能失效
|
|
|
+ */
|
|
|
+ proto.processMouseDown = function (hitinfo) {
|
|
|
+ const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+ const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
+ const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
+ const indent = col.indent ? col.indent : 10;
|
|
|
+ const centerX = hitinfo.cellStyle.hAlign === spreadNS.HorizontalAlign.right
|
|
|
+ ? hitinfo.cellRect.x + hitinfo.cellRect.width - indent -halfX
|
|
|
+ : hitinfo.cellRect.x + indent + halfX;
|
|
|
+ const centerY = hitinfo.cellRect.y + hitinfo.cellRect.height / 2;
|
|
|
+
|
|
|
+ if (Math.abs(hitinfo.x - centerX) < halfX && Math.abs(hitinfo.y - centerY) < halfY) {
|
|
|
+ const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
+ cell.tag(active);
|
|
|
+ hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ proto.processMouseUp = function (hitinfo) {
|
|
|
+ const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+ const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
+ const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
+ const indent = col.indent ? col.indent : 10;
|
|
|
+ const centerX = hitinfo.cellStyle.hAlign === spreadNS.HorizontalAlign.right
|
|
|
+ ? hitinfo.cellRect.x + hitinfo.cellRect.width - indent -halfX
|
|
|
+ : hitinfo.cellRect.x + indent + halfX;
|
|
|
+ const centerY = hitinfo.cellRect.y + hitinfo.cellRect.height / 2;
|
|
|
+
|
|
|
+ if (Math.abs(hitinfo.x - centerX) < halfX && Math.abs(hitinfo.y - centerY) < halfY) {
|
|
|
+ const imageClick = hitinfo.sheet.zh_setting ? hitinfo.sheet.zh_setting.imageClick : null;
|
|
|
+ if (imageClick && Object.prototype.toString.apply(imageClick) === "[object Function]") {
|
|
|
+ const sortData = SpreadJsObj.getSortData(hitinfo.sheet);
|
|
|
+ const data = sortData ? sortData[hitinfo.row] : null;
|
|
|
+ imageClick(data);
|
|
|
+ const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
+ cell.tag(hover);
|
|
|
+ hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ proto.processMouseMove = function (hitinfo) {
|
|
|
+ const col = hitinfo.sheet.zh_setting.cols[hitinfo.col];
|
|
|
+ const img = this.getImage(hitinfo.sheet, hitinfo.row, hitinfo.col);
|
|
|
+ const halfX = img.width / 2, halfY = img.height / 2;
|
|
|
+ const indent = col.indent ? col.indent : 10;
|
|
|
+ const centerX = hitinfo.cellStyle.hAlign === spreadNS.HorizontalAlign.right
|
|
|
+ ? hitinfo.cellRect.x + hitinfo.cellRect.width - indent -halfX
|
|
|
+ : hitinfo.cellRect.x + indent + halfX;
|
|
|
+ const centerY = hitinfo.cellRect.y + hitinfo.cellRect.height / 2;
|
|
|
+ const cell = hitinfo.sheet.getCell(hitinfo.row, hitinfo.col);
|
|
|
+ if (Math.abs(hitinfo.x - centerX) < halfX && Math.abs(hitinfo.y - centerY) < halfY) {
|
|
|
+ if (cell.tag() !== hover) {
|
|
|
+ cell.tag(hover);
|
|
|
+ hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (cell.tag() === hover) {
|
|
|
+ cell.tag(show);
|
|
|
+ hitinfo.sheet.repaint(hitinfo.cellRect);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
return new ImageCellType();
|
|
|
},
|
|
|
/**
|
|
@@ -1649,7 +1855,7 @@ const SpreadJsObj = {
|
|
|
};
|
|
|
const getAnalysisPasteHtml = function () {
|
|
|
return SpreadJsObj.analysisPasteHtml(cHtml);
|
|
|
- }
|
|
|
+ };
|
|
|
return {
|
|
|
setCopyData, getPasteData, clearData,
|
|
|
setSheetFilterCopyData,
|