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

delete draw text old

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51863 954022d7-b5bf-4e40-9824-e11837661b57
parent 122de6e9
...@@ -1396,151 +1396,6 @@ ...@@ -1396,151 +1396,6 @@
} }
//context.restore(); //context.restore();
} }
else
{
/**
* This calls the text function recursively to accommodate multi-line text
*/
if (typeof(text) == 'string' && text.match(/\r\n/)) {
var arr = text.split('\r\n');
text = arr[0];
arr = OfficeExcel.array_shift(arr);
var nextline = arr.join('\r\n')
OfficeExcel.Text(context, font, size, arguments[9] == -90 ? (x + (size * 1.5)) : x, y + (size * 1.5), nextline, arguments[6] ? arguments[6] : null, 'center', arguments[8], arguments[9], arguments[10], arguments[11], arguments[12]);
}
// Accommodate MSIE
if (OfficeExcel.isOld()) {
y += 2;
}
context.font = (arguments[11] ? 'Bold ': '') + size + 'pt ' + font;
var i;
var origX = x;
var origY = y;
var originalFillStyle = context.fillStyle;
var originalLineWidth = context.lineWidth;
// Need these now the angle can be specified, ie defaults for the former two args
if (typeof(arguments[6]) == null) arguments[6] = 'bottom'; // Vertical alignment. Default to bottom/baseline
if (typeof(arguments[7]) == null) arguments[7] = 'left'; // Horizontal alignment. Default to left
if (typeof(arguments[8]) == null) arguments[8] = null; // Show a bounding box. Useful for positioning during development. Defaults to false
if (typeof(arguments[9]) == null) arguments[9] = 0; // Angle (IN DEGREES) that the text should be drawn at. 0 is middle right, and it goes clockwise
if (typeof(arguments[12]) == null) arguments[12] = true; // Whether the bounding box has the placement indicator
// The alignment is recorded here for purposes of Opera compatibility
if (navigator.userAgent.indexOf('Opera') != -1) {
context.canvas.__OfficeExcel_valign__ = arguments[6];
context.canvas.__OfficeExcel_halign__ = arguments[7];
}
// First, translate to x/y coords
context.save();
context.canvas.__OfficeExcel_originalx__ = x;
context.canvas.__OfficeExcel_originaly__ = y;
context.translate(x, y);
x = 0;
y = 0;
// Rotate the canvas if need be
if (arguments[9]) {
context.rotate(arguments[9] / 57.3);
}
// Vertical alignment - defaults to bottom
if (arguments[6]) {
var vAlign = arguments[6];
if (vAlign == 'center') {
context.translate(0, size / 2);
} else if (vAlign == 'top') {
context.translate(0, size);
}
}
// Hoeizontal alignment - defaults to left
if (arguments[7]) {
var hAlign = arguments[7];
var width = context.measureText(text).width;
if (hAlign) {
if (hAlign == 'center') {
context.translate(-1 * (width / 2), 0)
} else if (hAlign == 'right') {
context.translate(-1 * width, 0)
}
}
}
context.fillStyle = originalFillStyle;
/**
* Draw a bounding box if requested
*/
context.save();
context.fillText(text,0,0);
context.lineWidth = 1;
if (arguments[8]) {
var width = context.measureText(text).width;
var ieOffset = OfficeExcel.isIE8() ? 2 : 0;
context.translate(x, y);
context.strokeRect(AA(context.canvas.__object__, - 3), AA(context.canvas.__object__, 0 - 3 - size - ieOffset), width + 6, 0 + size + 6);
/**
* If requested, draw a background for the text
*/
if (arguments[10]) {
var offset = 3;
var ieOffset = OfficeExcel.isIE8() ? 2 : 0;
var width = context.measureText(text).width
//context.strokeStyle = 'gray';
context.fillStyle = arguments[10];
context.fillRect(AA(context.canvas.__object__, x - offset),
AA(context.canvas.__object__, y - size - offset - ieOffset),
width + (2 * offset),
size + (2 * offset));
//context.strokeRect(x - offset, y - size - offset - ieOffset, width + (2 * offset), size + (2 * offset));
}
/**
* Do the actual drawing of the text
*/
context.fillStyle = originalFillStyle;
context.fillText(text,0,0);
if (arguments[12]) {
context.fillRect(
arguments[7] == 'left' ? 0 : (arguments[7] == 'center' ? width / 2 : width ) - 2,
arguments[6] == 'bottom' ? 0 : (arguments[6] == 'center' ? (0 - size) / 2 : 0 - size) - 2,
4,
4
);
}
}
context.restore();
// Reset the lineWidth
context.lineWidth = originalLineWidth;
context.restore();
}
} }
OfficeExcel.drawTurnedText = function(drawingCtx,textOptions, text, angle) OfficeExcel.drawTurnedText = function(drawingCtx,textOptions, text, angle)
......
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