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

fillGlyph в отдельную функию

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53907 954022d7-b5bf-4e40-9824-e11837661b57
parent 7e8ed194
...@@ -840,9 +840,7 @@ DrawingContext.prototype = { ...@@ -840,9 +840,7 @@ DrawingContext.prototype = {
return Height * setUpSize / UnitsPerEm; return Height * setUpSize / UnitsPerEm;
}, },
fillText: function (text, x, y, maxWidth, charWidths, angle) { fillGlyph: function (pGlyph, fmgr) {
var t = this;
function fillGlyph(pGlyph,fmgr) {
var nW = pGlyph.oBitmap.nWidth; var nW = pGlyph.oBitmap.nWidth;
var nH = pGlyph.oBitmap.nHeight; var nH = pGlyph.oBitmap.nHeight;
...@@ -851,9 +849,9 @@ DrawingContext.prototype = { ...@@ -851,9 +849,9 @@ DrawingContext.prototype = {
var nX = asc_floor(fmgr.m_oGlyphString.m_fX + pGlyph.fX + pGlyph.oBitmap.nX); var nX = asc_floor(fmgr.m_oGlyphString.m_fX + pGlyph.fX + pGlyph.oBitmap.nX);
var nY = asc_floor(fmgr.m_oGlyphString.m_fY + pGlyph.fY - pGlyph.oBitmap.nY); var nY = asc_floor(fmgr.m_oGlyphString.m_fY + pGlyph.fY - pGlyph.oBitmap.nY);
var _r = t.fillColor.r; var _r = this.fillColor.r;
var _g = t.fillColor.g; var _g = this.fillColor.g;
var _b = t.fillColor.b; var _b = this.fillColor.b;
if (window.g_isMobileVersion) { if (window.g_isMobileVersion) {
// Special for iPad (5.1) // Special for iPad (5.1)
...@@ -882,8 +880,9 @@ DrawingContext.prototype = { ...@@ -882,8 +880,9 @@ DrawingContext.prototype = {
pGlyph.oBitmap.oGlyphData.checkColor(_r, _g, _b, nW, nH); pGlyph.oBitmap.oGlyphData.checkColor(_r, _g, _b, nW, nH);
pGlyph.oBitmap.draw(this.ctx, nX, nY); pGlyph.oBitmap.draw(this.ctx, nX, nY);
} }
} },
fillText: function (text, x, y, maxWidth, charWidths, angle) {
var manager = angle ? this.fmgrGraphics[1] : this.fmgrGraphics[0]; var manager = angle ? this.fmgrGraphics[1] : this.fmgrGraphics[0];
var _x = this._mift.transformPointX(x, y); var _x = this._mift.transformPointX(x, y);
...@@ -899,7 +898,7 @@ DrawingContext.prototype = { ...@@ -899,7 +898,7 @@ DrawingContext.prototype = {
var pGlyph = manager.m_oGlyphString.m_pGlyphsBuffer[0]; var pGlyph = manager.m_oGlyphString.m_pGlyphsBuffer[0];
if (null === pGlyph || null === pGlyph.oBitmap) {continue;} if (null === pGlyph || null === pGlyph.oBitmap) {continue;}
fillGlyph.call(this, pGlyph,manager); this.fillGlyph(pGlyph, manager);
} }
return this; return this;
......
...@@ -1266,8 +1266,7 @@ ...@@ -1266,8 +1266,7 @@
if (1 === fullRecalc) { if (1 === fullRecalc) {
this.cols = []; this.cols = [];
} } else if (2 === fullRecalc) {
else if (2 === fullRecalc) {
i = this.cols.length; i = this.cols.length;
x = this.cols[i - 1].left + this.cols[i - 1].width; x = this.cols[i - 1].left + this.cols[i - 1].width;
} }
...@@ -1527,8 +1526,7 @@ ...@@ -1527,8 +1526,7 @@
maxCols = Math.max (maxCols, maxObjectsCoord.maxCol); maxCols = Math.max (maxCols, maxObjectsCoord.maxCol);
maxRows = Math.max (maxRows, maxObjectsCoord.maxRow); maxRows = Math.max (maxRows, maxObjectsCoord.maxRow);
} }
} } else {
else {
maxCols = activeRange.c2 + 1; maxCols = activeRange.c2 + 1;
maxRows = activeRange.r2 + 1; maxRows = activeRange.r2 + 1;
range = asc_Range(0, 0, maxCols, maxRows); range = asc_Range(0, 0, maxCols, maxRows);
...@@ -1653,8 +1651,7 @@ ...@@ -1653,8 +1651,7 @@
bIsAddOffset = true; bIsAddOffset = true;
++colIndex; ++colIndex;
break; break;
} } else
else
bIsAddOffset = false; bIsAddOffset = false;
} }
isCalcColumnsWidth = false; isCalcColumnsWidth = false;
...@@ -1713,8 +1710,7 @@ ...@@ -1713,8 +1710,7 @@
if (colIndex < maxCols) { if (colIndex < maxCols) {
currentColIndex = colIndex; currentColIndex = colIndex;
currentHeight = 0; currentHeight = 0;
} } else {
else {
// Мы дошли до конца отрисовки // Мы дошли до конца отрисовки
currentColIndex = colIndex; currentColIndex = colIndex;
currentRowIndex = rowIndex; currentRowIndex = rowIndex;
...@@ -2094,8 +2090,7 @@ ...@@ -2094,8 +2090,7 @@
ctx.setFillStyle(st.color) ctx.setFillStyle(st.color)
.fillText(text, textX, textY + tm.baseline, undefined, sr.charWidths); .fillText(text, textX, textY + tm.baseline, undefined, sr.charWidths);
ctx.RemoveClipRect(); ctx.RemoveClipRect();
} } else {
else {
ctx.save() ctx.save()
.beginPath() .beginPath()
.rect(x, y, w, h) .rect(x, y, w, h)
...@@ -3896,11 +3891,9 @@ ...@@ -3896,11 +3891,9 @@
} }
if (bUpdateScrollX && bUpdateScrollY) { if (bUpdateScrollX && bUpdateScrollY) {
this.handlers.trigger("reinitializeScroll"); this.handlers.trigger("reinitializeScroll");
} } else if (bUpdateScrollX) {
else if (bUpdateScrollX) {
this.handlers.trigger("reinitializeScrollX"); this.handlers.trigger("reinitializeScrollX");
} } else if (bUpdateScrollY) {
else if (bUpdateScrollY) {
this.handlers.trigger("reinitializeScrollY"); this.handlers.trigger("reinitializeScrollY");
} }
...@@ -3980,8 +3973,7 @@ ...@@ -3980,8 +3973,7 @@
maxWidth: maxW - this.cols[col].innerWidth + this.cols[col].width, maxWidth: maxW - this.cols[col].innerWidth + this.cols[col].width,
leftSide: 0, leftSide: 0,
rightSide: 0 rightSide: 0
} : } : this._calcCellTextOffset(col, row, ha, tm.width);
this._calcCellTextOffset(col, row, ha, tm.width);
// check right side of cell text and append columns if it exceeds existing cells borders // check right side of cell text and append columns if it exceeds existing cells borders
if (!fl.isMerged) { if (!fl.isMerged) {
......
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