|
@@ -490,16 +490,19 @@ const projTreeObj = {
|
|
|
GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
|
|
|
};
|
|
|
TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
|
|
|
- return {
|
|
|
- x: x,
|
|
|
- y: y,
|
|
|
- row: context.row,
|
|
|
- col: context.col,
|
|
|
- cellStyle: cellStyle,
|
|
|
- cellRect: cellRect,
|
|
|
- sheetArea: context.sheetArea,
|
|
|
- isReservedLocation: true
|
|
|
- };
|
|
|
+ let info = {x: x, y: y, row: context.row, col: context.col, cellStyle: cellStyle, cellRect: cellRect, sheetArea: context.sheetArea};
|
|
|
+ let node = tree.items[info.row];
|
|
|
+ let offset = -1;
|
|
|
+ let centerX = info.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
|
|
|
+ let text = context.sheet.getText(info.row, info.col);
|
|
|
+ let value = context.sheet.getValue(info.row, info.col);
|
|
|
+ let acStyle = context.sheet.getActualStyle(info.row, info.col),
|
|
|
+ zoom = context.sheet.zoom();
|
|
|
+ let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: context.sheet, row: info.row, col: info.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
|
|
|
+ if(info.x > centerX + halfBoxLength && info.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength){
|
|
|
+ info.isReservedLocation = true;
|
|
|
+ }
|
|
|
+ return info;
|
|
|
};
|
|
|
TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
|
|
|
let offset = -1;
|
|
@@ -569,15 +572,7 @@ const projTreeObj = {
|
|
|
let canvasId = div.id + "vp_vp";
|
|
|
let canvas = $(`#${canvasId}`)[0];
|
|
|
//改变鼠标图案
|
|
|
- let node = tree.items[hitInfo.row];
|
|
|
- let offset = -1;
|
|
|
- let centerX = hitInfo.cellRect.x + offset + node.depth() * indent + node.depth() * levelIndent + indent / 2;
|
|
|
- let text = hitInfo.sheet.getText(hitInfo.row, hitInfo.col);
|
|
|
- let value = hitInfo.sheet.getValue(hitInfo.row, hitInfo.col);
|
|
|
- let acStyle = hitInfo.sheet.getActualStyle(hitInfo.row, hitInfo.col),
|
|
|
- zoom = hitInfo.sheet.zoom();
|
|
|
- let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitInfo.sheet, row: hitInfo.row, col: hitInfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
|
|
|
- if (sheet && hitInfo.x > centerX + halfBoxLength && hitInfo.x < centerX + halfBoxLength + imgWidth + indent/2+3 + textLength) {
|
|
|
+ if (sheet && hitInfo.isReservedLocation) {
|
|
|
canvas.style.cursor='pointer';
|
|
|
return true;
|
|
|
}else{
|