Commit a38cde8a authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил расчет координат относительно листа

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56204 954022d7-b5bf-4e40-9824-e11837661b57
parent 75a7dc05
......@@ -5353,19 +5353,21 @@
// x,y - абсолютные координаты относительно листа (без учета заголовков)
WorksheetView.prototype.findCellByXY = function (x, y) {
var r = 0, c = 0, result = new CCellObjectInfo();
var r = 0, c = 0, tmpRow, tmpCol, result = new CCellObjectInfo();
x += this.cellsLeft;
y += this.cellsTop;
while (c < this.cols.length) {
if (x >= this.cols[c].left && this.width_1px <= this.cols[c].width) {
result.col = c;
tmpCol = this.cols[c];
if (x <= tmpCol.left + tmpCol.width) {
result.col = c - 1;
break;
}
++c;
}
while (r < this.rows.length && y < this.rows[r].top) {
if (y >= this.rows[r].top && this.height_1px <= this.rows[r].height) {
result.row = r;
while (r < this.rows.length) {
tmpRow = this.rows[r];
if (y <= tmpRow.top + tmpRow.height) {
result.row = r - 1;
break;
}
++r;
......
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