Commit 6f3f07c1 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил расчет ширины столбца, когда она меньше 1 символа.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57999 954022d7-b5bf-4e40-9824-e11837661b57
parent ba15d1a8
......@@ -1175,7 +1175,10 @@
*/
WorksheetView.prototype._colWidthToCharCount = function (w) {
var px = w * asc_getcvt(1/*pt*/, 0/*px*/, 96);
return px <= this.settings.cells.paddingPlusBorder ? 0 : asc_floor((px - this.settings.cells.paddingPlusBorder) / this.maxDigitWidth * 100 + 0.5) / 100;
var pxInOneCharacter = this.maxDigitWidth + this.settings.cells.paddingPlusBorder;
// Когда меньше 1 символа, то просто считаем по пропорции относительно размера 1-го символа
return px < pxInOneCharacter ? (1 - asc_floor(100 * (pxInOneCharacter - px) / pxInOneCharacter + 0.49999) / 100) :
asc_floor((px - this.settings.cells.paddingPlusBorder) / this.maxDigitWidth * 100 + 0.5) / 100;
};
/**
......
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