Commit 418fa4a9 authored by Alexander.Trofimov's avatar Alexander.Trofimov

add ConvertLogicToXY

parent 49e722df
......@@ -3024,6 +3024,9 @@
WorkbookView.prototype.ConvertXYToLogic = function (x, y) {
return this.getWorksheet().ConvertXYToLogic(x, y);
};
WorkbookView.prototype.ConvertLogicToXY = function (xL, yL) {
return this.getWorksheet().ConvertLogicToXY(xL, yL);
};
//------------------------------------------------------------export---------------------------------------------------
window['AscCommonExcel'] = window['AscCommonExcel'] || {};
......
......@@ -13164,13 +13164,40 @@
}
}
x += this.cols[c].left + this.cols[c].width;
y += this.rows[r].top + this.rows[r].height;
x += this.cols[c].left;
y += this.rows[r].top;
x *= asc_getcvt(1/*px*/, 3/*pt*/, this._getPPIX());
y *= asc_getcvt(1/*px*/, 3/*pt*/, this._getPPIY());
x *= asc_getcvt(1/*pt*/, 3/*mm*/, this._getPPIX());
y *= asc_getcvt(1/*pt*/, 3/*mm*/, this._getPPIY());
return {X: x, Y: y};
};
WorksheetView.prototype.ConvertLogicToXY = function (xL, yL) {
xL *= asc_getcvt(3/*mm*/, 1/*pt*/, this._getPPIX());
yL *= asc_getcvt(3/*mm*/, 1/*pt*/, this._getPPIY());
var c = this.visibleRange.c1, cFrozen, widthDiff;
var r = this.visibleRange.r1, rFrozen, heightDiff;
if (this.topLeftFrozenCell) {
cFrozen = this.topLeftFrozenCell.getCol0();
widthDiff = this.cols[cFrozen].left - this.cols[0].left;
if (xL < this.cellsLeft + widthDiff && 0 !== widthDiff) {
c = 0;
}
rFrozen = this.topLeftFrozenCell.getRow0();
heightDiff = this.rows[rFrozen].top - this.rows[0].top;
if (yL < this.cellsTop + heightDiff && 0 !== heightDiff) {
r = 0;
}
}
xL -= this.cols[c].left;
yL -= this.rows[r].top;
xL *= asc_getcvt(1/*pt*/, 0/*px*/, this._getPPIX());
yL *= asc_getcvt(1/*pt*/, 0/*px*/, this._getPPIY());
return {X: xL, Y: yL};
};
//------------------------------------------------------------export---------------------------------------------------
window['AscCommonExcel'] = window['AscCommonExcel'] || {};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment