Commit 8624264a authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

borderBox properties : strikeH and strikeV

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50352 954022d7-b5bf-4e40-9824-e11837661b57
parent 4c43992b
......@@ -10,6 +10,9 @@ function CBorderBox()
this.bLDiag = false;
this.bRDiag = false;
this.bHor = false;
this.bVert = false;
CMathBase.call(this);
}
extend(CBorderBox, CMathBase);
......@@ -31,6 +34,12 @@ CBorderBox.prototype.init = function(props)
if(props.strikeTLBR === true || props.strikeTLBR === 1)
this.bRDiag = true;
if(props.strikeH === true || props.strikeH === 1)
this.bHor = true;
if(props.strikeV === true || props.strikeV === 1)
this.bVert = true;
}
this.setDimension(1, 1);
......@@ -72,7 +81,7 @@ CBorderBox.prototype.draw = function(pGraphics)
var x1 = this.pos.x,
x2 = this.pos.x + this.size.width - 25.4/96,
y1 = y2 = this.pos.y;
y1 = this.pos.y;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
......@@ -82,7 +91,7 @@ CBorderBox.prototype.draw = function(pGraphics)
{
var x1 = this.pos.x,
x2 = this.pos.x + this.size.width - 25.4/96,
y1 = y2 = this.pos.y + this.size.height - penW;
y1 = this.pos.y + this.size.height - penW;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
......@@ -133,10 +142,11 @@ CBorderBox.prototype.draw = function(pGraphics)
pGraphics.df();
}
if(this.bRDiag)
{
var pW = penW*0.8;
var x1 = this.pos.x + this.size.width - pW - 25.4/96, y1 = this.pos.y,
var x1 = this.pos.x + this.size.width/2 - pW - 25.4/96, y1 = this.pos.y,
x2 = x1 + pW, y2 = y1,
x3 = x2, y3 = y2 + pW,
x4 = this.pos.x + pW, y4 = this.pos.y + this.size.height - 25.4/96,
......@@ -159,6 +169,26 @@ CBorderBox.prototype.draw = function(pGraphics)
}
if(this.bHor)
{
var x1 = this.pos.x,
x2 = this.pos.x + this.size.width - 25.4/96,
y1 = this.pos.y + this.size.height/2 - penW/2;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
if(this.bVert)
{
var x1 = this.pos.x + this.size.width/2 - penW/2,
y1 = this.pos.y,
y2 = this.pos.y + this.size.height - 25.4/96;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
}
CBorderBox.prototype.setPosition = function(pos)
{
......@@ -225,7 +255,7 @@ CBorderBox.prototype.findDisposition = function(mCoord)
return {pos: posCurs, mCoord: coord, inside_flag: inside_flag};
}
CBorderBox.prototype.getElement = function()
CBorderBox.prototype.getBase = function()
{
return this.elements[0][0];
}
......
......@@ -4319,7 +4319,7 @@ CMathContent.prototype =
var borderBox = this.addMComponent(MATH_BORDER_BOX);
borderBox.init(props);
var arg = borderBox.getElement();
var arg = borderBox.getBase();
var degrA = arg.addMComponent(MATH_DEGREE);
var props = {type: DEGREE_SUPERSCRIPT};
......@@ -7247,5 +7247,3 @@ function CEmpty()
this.relate = function() {};
}
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