Commit 825c9bc1 authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

Поправлены баги связанные с заливкой (whiteSquareBracket и двойной стрелки...

Поправлены баги связанные с заливкой (whiteSquareBracket и двойной стрелки некорретно применялась заливка)
Реализовала поддержку цвета текста и Just-Draw элементов при чтении файла и при его сохранении

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59566 954022d7-b5bf-4e40-9824-e11837661b57
parent bdf3412c
......@@ -1340,11 +1340,12 @@ ParaMath.prototype.Draw_Elements = function(PDSE)
// this.absPos.x ~> this.X
// this.absPos.y ~> this.Y
this.Root.draw( PDSE.X, PDSE.Y - this.Ascent, PDSE.Graphics);
PDSE.X += this.Width;
PDSE.Y -= this.Ascent;
this.Root.draw( PDSE.X, PDSE.Y, PDSE.Graphics, PDSE);
PDSE.Y += this.Ascent;
PDSE.X += this.Width;
}
/*PDSE.Graphics.p_color(255,0,0, 255);
......
......@@ -3316,6 +3316,27 @@ ParaRun.prototype.Draw_Elements = function(PDSE)
var CurTextPr = this.Get_CompiledPr( false );
pGraphics.SetTextPr( CurTextPr, Theme );
if(this.Type == para_Math_Run)
{
Y += this.size.ascent;
var Font =
{
Bold : CurTextPr.Bold,
Italic : CurTextPr.Italic,
FontFamily : {Name : CurTextPr.FontFamily.Name, Index : CurTextPr.FontFamily.Index},
FontSize : this.Parent.ParaMath.ApplyArgSize(CurTextPr.FontSize, this.Parent.Compiled_ArgSz.value)
};
if(this.IsMathematicalText()) // выставляем false, чтобы не применился наклон к спец символам
{
Font.Italic = false;
Font.Bold = false;
}
pGraphics.SetFont(Font);
}
if ( undefined !== CurTextPr.Shd && shd_Nil !== CurTextPr.Shd.Value )
BgColor = CurTextPr.Shd.Get_Color( Para );
......@@ -3347,7 +3368,9 @@ ParaRun.prototype.Draw_Elements = function(PDSE)
pGraphics.b_color1( RGBA.R, RGBA.G, RGBA.B, RGBA.A );
}
else if ( true === CurTextPr.Color.Auto )
{
pGraphics.b_color1( AutoColor.r, AutoColor.g, AutoColor.b, 255);
}
else
{
pGraphics.b_color1( CurTextPr.Color.r, CurTextPr.Color.g, CurTextPr.Color.b, 255);
......@@ -3473,6 +3496,13 @@ ParaRun.prototype.Draw_Elements = function(PDSE)
X += Item.WidthVisible;
break;
}
case para_Math_Ampersand:
case para_Math_Text:
case para_Math_Placeholder:
{
Item.draw(X, Y, pGraphics );
break;
}
}
Y = TempY;
......
......@@ -143,7 +143,7 @@ CAccentLine.prototype.draw = function(x, y, pGraphics)
var x1 = x + 25.4/96,
x2 = x + this.stretch - 25.4/96;
pGraphics.p_color(0,0,0, 255);
//pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y, x1, x2, penW);
}
......@@ -190,7 +190,7 @@ CAccentDoubleLine.prototype.draw = function(x, y, pGraphics)
y1 = y,
y2 = y + diff;
pGraphics.p_color(0,0,0, 255);
//pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
pGraphics.drawHorLine(0, y2, x1, x2, penW);
......@@ -537,10 +537,10 @@ CAccent.prototype.Resize = function(oMeasure, RPI)
this.size = {height: height, width: width, ascent: ascent};
};
CAccent.prototype.draw = function(x, y, pGraphics)
CAccent.prototype.draw = function(x, y, pGraphics, PDSE)
{
var base = this.elements[0][0];
base.draw(x, y, pGraphics);
base.draw(x, y, pGraphics, PDSE);
var Info =
{
......@@ -569,7 +569,7 @@ CAccent.prototype.draw = function(x, y, pGraphics)
}
}
this.operator.draw(x, y, pGraphics);
this.operator.draw(x, y, pGraphics, PDSE);
};
CAccent.prototype.Document_UpdateInterfaceState = function(MathProps)
{
......
......@@ -118,21 +118,7 @@ CMathBase.prototype =
for(var j = 0; j < this.nCol; j++)
if(!this.elements[i][j].IsJustDraw())
this.elements[i][j].NeedCompiledCtrPr();
},
/*Set_CompiledCtrPrp: function(ParaMath)
{
var defaultRPrp = ParaMath.GetFirstRPrp();
this.CompiledCtrPrp.Merge(defaultRPrp);
this.CompiledCtrPrp.Merge(this.CtrPrp);
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
if(this.elements[i][j].Type === para_Math_Composition)
this.elements[i][j].Set_CompiledCtrPrp(ParaMath);
},*/
Get_CompiledCtrPrp: function()
{
this.Set_CompiledCtrPrp(this.Parent, this.ParaMath);
......@@ -170,16 +156,6 @@ CMathBase.prototype =
{
return this.Parent.Get_CompiledArgSize();
},
getCtrPrpForFirst: function(ParaMath)
{
var ctrPrp = new CTextPr();
var defaultRPrp = ParaMath.Get_Default_TPrp();
//var gWPrp = defaultRPrp.getMergedWPrp();
ctrPrp.Merge(defaultRPrp);
ctrPrp.Merge(this.CtrPrp);
return ctrPrp;
},
// для управляющих символов в приоритете GetFirstRunPrp
// если первый элемент - мат объект, то берутся его CtrPrp
GetTPrpToControlLetter: function()
......@@ -343,11 +319,13 @@ CMathBase.prototype =
h += Heights[i];
}
},
draw: function(x, y, pGraphics)
draw: function(x, y, pGraphics, PDSE)
{
this.Make_ShdColor(PDSE, this.Get_CompiledCtrPrp()); // для Just-Draw элементов
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
this.elements[i][j].draw(x, y, pGraphics);
this.elements[i][j].draw(x, y, pGraphics, PDSE);
},
remove: function(order)
{
......@@ -430,7 +408,20 @@ CMathBase.prototype =
// for Ctr Prp
//this.CompiledCtrPrp = ParaMath.GetFirstRPrp();
this.CompiledCtrPrp = new CTextPr();
//this.CompiledCtrPrp = new CTextPr();
// Получим настройки текста, для данного параграфа
this.CompiledCtrPrp = this.ParaMath.Paragraph.Get_CompiledPr2(false).TextPr.Copy();
this.CompiledCtrPrp.Merge(this.ParaMath.Get_Default_TPrp());
// Если в прямых настройках задан стиль, тогда смержим настройки стиля
if ( undefined != this.CtrPrp.RStyle )
{
var Styles = this.ParaMath.Paragraph.Parent.Get_Styles();
var StyleTextPr = Styles.Get_Pr( this.CtrPrp.RStyle, styletype_Character ).TextPr;
this.CompiledCtrPrp.Merge( StyleTextPr );
}
var defaultTxtPrp = ParaMath.Get_Default_TPrp();
this.CompiledCtrPrp.FontFamily =
......@@ -681,7 +672,6 @@ CMathBase.prototype =
}
}
},
GetMathTextPr: function(ContentPos, Depth)
{
var pos = ContentPos.Get(Depth);
......@@ -1044,6 +1034,59 @@ CMathBase.prototype.Draw_HighLights = function(PDSH, bAll)
PDSH.X = this.pos.x + this.ParaMath.X + this.size.width;
};
CMathBase.prototype.Make_ShdColor = function(PDSE, CurTextPr)
{
var Para = PDSE.Paragraph;
var pGraphics = PDSE.Graphics;
var BgColor = PDSE.BgColor;
if ( undefined !== CurTextPr.Shd && shd_Nil !== CurTextPr.Shd.Value )
BgColor = CurTextPr.Shd.Get_Color( Para );
var AutoColor = ( undefined != BgColor && false === BgColor.Check_BlackAutoColor() ? new CDocumentColor( 255, 255, 255, false ) : new CDocumentColor( 0, 0, 0, false ) );
var RGBA;
if(CurTextPr.Unifill)
{
CurTextPr.Unifill.check(PDSE.Theme, PDSE.ColorMap);
RGBA = CurTextPr.Unifill.getRGBAColor();
if ( true === PDSE.VisitedHyperlink && ( undefined === this.Pr.Color && undefined === this.Pr.Unifill ) )
{
G_O_VISITED_HLINK_COLOR.check(PDSE.Theme, PDSE.ColorMap);
RGBA = G_O_VISITED_HLINK_COLOR.getRGBAColor();
pGraphics.p_color( RGBA.R, RGBA.G, RGBA.B, RGBA.A );
pGraphics.b_color1( RGBA.R, RGBA.G, RGBA.B, RGBA.A );
}
else
{
pGraphics.p_color( RGBA.R, RGBA.G, RGBA.B, RGBA.A );
pGraphics.b_color1( RGBA.R, RGBA.G, RGBA.B, RGBA.A);
}
}
else
{
if ( true === PDSE.VisitedHyperlink && ( undefined === this.Pr.Color && undefined === this.Pr.Unifill ) )
{
G_O_VISITED_HLINK_COLOR.check(PDSE.Theme, PDSE.ColorMap);
RGBA = G_O_VISITED_HLINK_COLOR.getRGBAColor();
pGraphics.p_color( RGBA.R, RGBA.G, RGBA.B, RGBA.A );
pGraphics.b_color1( RGBA.R, RGBA.G, RGBA.B, RGBA.A );
}
else if ( true === CurTextPr.Color.Auto )
{
pGraphics.p_color( AutoColor.r, AutoColor.g, AutoColor.b, 255);
pGraphics.b_color1( AutoColor.r, AutoColor.g, AutoColor.b, 255);
}
else
{
pGraphics.p_color( CurTextPr.Color.r, CurTextPr.Color.g, CurTextPr.Color.b, 255);
pGraphics.b_color1( CurTextPr.Color.r, CurTextPr.Color.g, CurTextPr.Color.b, 255);
}
}
return BgColor;
};
CMathBase.prototype.protected_AddToContent = function(Pos, Items, bUpdatePosition)
{
History.Add(this, new CChangesMathAddItems(Pos, Items));
......@@ -1073,7 +1116,6 @@ CMathBase.prototype.private_UpdatePosOnAdd = CMathContent.prototype.private
CMathBase.prototype.private_UpdatePosOnRemove = CMathContent.prototype.private_UpdateOnRemove;
CMathBase.prototype.private_CorrectSelectionPos = CMathContent.prototype.private_CorrectSelectionPos;
CMathBase.prototype.private_SetNeedResize = CMathContent.prototype.private_SetNeedResize;
CMathBase.prototype.private_CorrectCurPos = function()
{
if (this.CurPos > this.Content.length - 1)
......@@ -1088,14 +1130,11 @@ CMathBase.prototype.private_CorrectCurPos = function()
this.Content[this.CurPos].Cursor_MoveToStartPos();
}
}
CMathBase.prototype.Search = ParaHyperlink.prototype.Search;
CMathBase.prototype.Add_SearchResult = ParaHyperlink.prototype.Add_SearchResult;
CMathBase.prototype.Clear_SearchResults = ParaHyperlink.prototype.Clear_SearchResults;
CMathBase.prototype.Remove_SearchResult = ParaHyperlink.prototype.Remove_SearchResult;
CMathBase.prototype.Search_GetId = ParaHyperlink.prototype.Search_GetId;
CMathBase.prototype.Set_SelectionContentPos = ParaHyperlink.prototype.Set_SelectionContentPos;
CMathBase.prototype.Get_LeftPos = ParaHyperlink.prototype.Get_LeftPos;
CMathBase.prototype.Get_RightPos = ParaHyperlink.prototype.Get_RightPos;
......@@ -1127,7 +1166,6 @@ CMathBase.prototype.Document_UpdateInterfaceState = function(MathProps)
function CMathBasePr()
{
};
CMathBasePr.prototype.Set_FromObject = function(Obj){};
CMathBasePr.prototype.Copy = function(){return new CMathBasePr();};
CMathBasePr.prototype.Write_ToBinary = function(Writer){};
......
......@@ -201,9 +201,9 @@ CBorderBox.prototype.recalculateSize = function()
this.size = {width : width, height: height, ascent: ascent};
}
CBorderBox.prototype.draw = function(x, y, pGraphics)
CBorderBox.prototype.draw = function(x, y, pGraphics, PDSE)
{
this.elements[0][0].draw(x, y, pGraphics);
this.elements[0][0].draw(x, y, pGraphics, PDSE);
var penW = this.GetTPrpToControlLetter().FontSize*0.02;
......@@ -213,14 +213,16 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
var X = this.pos.x + x + this.GapLeft,
Y = this.pos.y + y;
this.Make_ShdColor(PDSE, this.Get_CompiledCtrPrp());
if(!this.Pr.hideTop)
{
var x1 = X,
x2 = X + Width,
y1 = Y;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
if(!this.Pr.hideBot)
......@@ -229,8 +231,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
x2 = X + Width,
y1 = Y + Height;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(2, y1, x1, x2, penW);
pGraphics.drawHorLine(2, y1, x1, x2, penW);
}
if(!this.Pr.hideLeft)
......@@ -239,7 +240,6 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
y1 = Y,
y2 = Y + Height;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
......@@ -249,7 +249,6 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
y1 = Y,
y2 = Y + Height;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawVerLine(2, x1, y1, y2, penW);
}
......@@ -261,7 +260,6 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
x2 = X + Width, y2 = Y + Height;
pGraphics.p_width(180);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
......@@ -281,7 +279,6 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
x7 = X, y7 = Y;
pGraphics.p_width(1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
......@@ -304,7 +301,6 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
x2 = X, y2 = Y + Height;
pGraphics.p_width(180);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
......@@ -325,7 +321,6 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.p_width(1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
......@@ -346,7 +341,6 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
x2 = X + Width,
y1 = Y + Height/2 - penW/2;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
......@@ -356,7 +350,6 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
y1 = Y,
y2 = Y + Height;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
......@@ -381,11 +374,6 @@ CBorderBox.prototype.setPosition = function(pos, PosInfo)
this.elements[0][0].setPosition(NewPos, PosInfo);
}
CBorderBox.prototype.Document_UpdateInterfaceState = function(MathProps)
{
MathProps.Type = c_oAscMathInterfaceType.BorderBox;
MathProps.Pr = null;
};
function CMathBoxPr()
{
......@@ -437,7 +425,6 @@ CMathBoxPr.prototype.Copy = function()
if(this.brk !== undefined)
NewPr.brk = this.brk.Copy();
return NewPr;
};
......@@ -524,11 +511,6 @@ CBox.prototype.getBase = function()
{
return this.Content[0];
}
CBox.prototype.Document_UpdateInterfaceState = function(MathProps)
{
MathProps.Type = c_oAscMathInterfaceType.Box;
MathProps.Pr = null;
};
function CMathBarPr()
......@@ -626,11 +608,6 @@ CBar.prototype.getAscent = function()
return ascent;
}
CBar.prototype.Document_UpdateInterfaceState = function(MathProps)
{
MathProps.Type = c_oAscMathInterfaceType.Bar;
MathProps.Pr = null;
};
function CMathPhantomPr()
{
......@@ -745,9 +722,4 @@ CPhantom.prototype.fillContent = function()
{
this.setDimension(1, 1);
this.elements[0][0] = this.getBase();
}
CPhantom.prototype.Document_UpdateInterfaceState = function(MathProps)
{
MathProps.Type = c_oAscMathInterfaceType.Phantom;
MathProps.Pr = null;
};
\ No newline at end of file
}
\ No newline at end of file
......@@ -4,26 +4,22 @@ function CMathFractionPr()
{
this.type = BAR_FRACTION;
}
CMathFractionPr.prototype.Set_FromObject = function(Obj)
{
if (undefined !== Obj.type && null !== Obj.type)
this.type = Obj.type;
};
CMathFractionPr.prototype.Copy = function(Obj)
{
var NewPr = new CMathFractionPr();
NewPr.type = this.type;
return NewPr;
};
CMathFractionPr.prototype.Write_ToBinary = function(Writer)
{
// Long : type
Writer.WriteLong(this.type);
};
CMathFractionPr.prototype.Read_FromBinary = function(Reader)
{
// Long : type
......@@ -64,16 +60,16 @@ CFraction.prototype.getType = function()
{
return this.Pr.type;
}
CFraction.prototype.draw = function(x, y, pGraphics)
CFraction.prototype.draw = function(x, y, pGraphics, PDSE)
{
if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)
this.drawBarFraction(x, y, pGraphics);
this.drawBarFraction(x, y, pGraphics, PDSE);
else if(this.Pr.type == SKEWED_FRACTION)
this.drawSkewedFraction(x, y, pGraphics);
this.drawSkewedFraction(x, y, pGraphics, PDSE);
else if(this.Pr.type == LINEAR_FRACTION)
this.drawLinearFraction(x, y, pGraphics);
this.drawLinearFraction(x, y, pGraphics, PDSE);
}
CFraction.prototype.drawBarFraction = function(x, y, pGraphics)
CFraction.prototype.drawBarFraction = function(x, y, pGraphics, PDSE)
{
var mgCtrPrp = this.GetTPrpToControlLetter();
......@@ -91,14 +87,13 @@ CFraction.prototype.drawBarFraction = function(x, y, pGraphics)
{
pGraphics.SetFont(mgCtrPrp);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
this.Make_ShdColor(PDSE, this.Get_CompiledCtrPrp());
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
CFraction.superclass.draw.call(this, x, y, pGraphics);
CFraction.superclass.draw.call(this, x, y, pGraphics, PDSE);
}
CFraction.prototype.drawSkewedFraction = function(x, y, pGraphics)
CFraction.prototype.drawSkewedFraction = function(x, y, pGraphics, PDSE)
{
var mgCtrPrp = this.GetTPrpToControlLetter();
......@@ -184,16 +179,15 @@ CFraction.prototype.drawSkewedFraction = function(x, y, pGraphics)
pGraphics.p_width(penW*1000);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
this.Make_ShdColor(PDSE, this.Get_CompiledCtrPrp());
pGraphics._s();
pGraphics._m(xx1, yy1);
pGraphics._l(xx2, yy2);
pGraphics.ds();
CFraction.superclass.draw.call(this, x, y, pGraphics);
CFraction.superclass.draw.call(this, x, y, pGraphics, PDSE);
}
CFraction.prototype.drawLinearFraction = function(x, y, pGraphics)
CFraction.prototype.drawLinearFraction = function(x, y, pGraphics, PDSE)
{
var shift = 0.1*this.dW;
......@@ -211,15 +205,14 @@ CFraction.prototype.drawLinearFraction = function(x, y, pGraphics)
pGraphics.SetFont(mgCtrPrp);
pGraphics.p_width(penW*1000);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
this.Make_ShdColor(PDSE, this.Get_CompiledCtrPrp());
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics.ds();
CFraction.superclass.draw.call(this, x, y, pGraphics);
CFraction.superclass.draw.call(this, x, y, pGraphics, PDSE);
}
CFraction.prototype.getNumerator = function()
{
......
......@@ -74,10 +74,6 @@ CMathPointInfo.prototype.SetInfoPoints = function(InfoPoints)
this.InfoPoints.ContentPoints = InfoPoints.ContentPoints.Widths;
this.InfoPoints.GMaxDimWidths = InfoPoints.GMaxDimWidths;
}
CMathPointInfo.prototype.UpdateX = function(value)
{
this.x += value;
}
CMathPointInfo.prototype.NextAlignRange = function()
{
if(this.bEven)
......@@ -88,10 +84,6 @@ CMathPointInfo.prototype.NextAlignRange = function()
this.bEven = true;
}
}
CMathPointInfo.prototype.ApplyAlign = function()
{
this.x += this.GetAlign();
}
CMathPointInfo.prototype.GetAlign = function()
{
var align = 0;
......@@ -746,7 +738,6 @@ CMathContent.prototype =
this.size = {width: width, height: ascent + descent, ascent: ascent};
},*/
PreRecalc: function(Parent, ParaMath, ArgSize, RPI)
{
if(ArgSize !== null && ArgSize !== undefined)
......@@ -912,7 +903,7 @@ CMathContent.prototype =
return bOneLineText;
},
draw: function(x, y, pGraphics)
draw: function(x, y, pGraphics, PDSE)
{
var bHidePlh = this.plhHide && this.IsPlaceholder();
......@@ -922,10 +913,11 @@ CMathContent.prototype =
{
if(this.Content[i].Type == para_Math_Composition)
{
this.Content[i].draw(x, y, pGraphics);
this.Content[i].draw(x, y, pGraphics, PDSE);
}
else
this.Content[i].Math_Draw(x, y, pGraphics);
this.Content[i].Draw_Elements(PDSE);
//this.Content[i].Math_Draw(x, y, pGraphics);
}
}
},
......@@ -1054,7 +1046,6 @@ CMathContent.prototype =
return result;
},
////////////////////////
/// For Para Math
GetParent: function()
{
......@@ -1068,11 +1059,9 @@ CMathContent.prototype =
{
return this.ArgSize.value;
},
///////// Перемещение ////////////
// Поиск позиции, селект
Is_SelectedAll: function(Props)
{
var bFirst = false, bEnd = false;
......
......@@ -872,7 +872,7 @@ CMathAmp.prototype =
var X = x + this.pos.x + this.size.width,
Y = y + this.pos.y,
Y2 = y + this.pos.y - this.AmpText.size.height;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawVerLine(0, X, Y, Y2, 0.1);
}
},
......
......@@ -667,8 +667,10 @@ function CNaryOperator(flip)
this.bFlip = (flip == -1);
this.sizeGlyph = null;
}
CNaryOperator.prototype.draw = function(x, y, pGraphics)
CNaryOperator.prototype.draw = function(x, y, pGraphics, PDSE)
{
this.Parent.Make_ShdColor(PDSE, this.Parent.Get_CompiledCtrPrp());
if(this.Type == para_Math_Text)
this.drawTextElem(x, y, pGraphics);
else
......@@ -712,8 +714,8 @@ CNaryOperator.prototype.drawGlyph = function(x, y,pGraphics)
pGraphics.p_width(1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics.p_color(0,0,0, 255);
//pGraphics.b_color1(0,0,0, 255);
//pGraphics.p_color(0,0,0, 255);
pGraphics._s();
this.drawPath(pGraphics, XX,YY);
......@@ -723,7 +725,7 @@ CNaryOperator.prototype.drawGlyph = function(x, y,pGraphics)
}
CNaryOperator.prototype.drawTextElem = function(x, y, pGraphics)
{
pGraphics.b_color1(0,0,0,255);
//pGraphics.b_color1(0,0,0,255);
var ctrPrp = this.GetTPrpToControlLetter();
......@@ -1449,69 +1451,6 @@ CIntegral.prototype.getCoord = function()
return {X: X, Y: Y, W : W, H: H};
}
CIntegral.prototype.old_getCoord = function()
{
var X = [],
Y = [];
X[0] = 20407; Y[0] = 65723;
X[1] = 20407; Y[1] = 60840;
X[2] = 20407; Y[2] = 37013;
X[3] = 24333; Y[3] = 18507;
X[4] = 28260; Y[4] = 0;
X[5] = 40590; Y[5] = 0;
X[6] = 42142; Y[6] = 0;
X[7] = 43604; Y[7] = 383;
X[8] = 45067; Y[8] = 765;
X[9] = 46215; Y[9] = 1305;
X[10] = 45180; Y[10] = 9225;
X[11] = 41760; Y[11] = 9225;
X[12] = 41512; Y[12] = 7335;
X[13] = 40724; Y[13] = 6064;
X[14] = 39937; Y[14] = 4793;
X[15] = 37935; Y[15] = 4793;
X[16] = 30465; Y[16] = 4793;
X[17] = 28406; Y[17] = 23086;
X[18] = 26347; Y[18] = 41378;
X[19] = 26347; Y[19] = 60840;
X[20] = 26347; Y[20] = 65723;
X[21] = 26325; Y[21] = 65723;
X[22] = 26325; Y[22] = 99091;
X[23] = 21622; Y[23] = 115404;
X[24] = 16920; Y[24] = 131716;
X[25] = 5467; Y[25] = 131716;
X[26] = 4387; Y[26] = 131716;
X[27] = 2947; Y[27] = 131356;
X[28] = 1507; Y[28] = 130996;
X[29] = 0; Y[29] = 130276;
X[30] = 1147; Y[30] = 121388;
X[31] = 4770; Y[31] = 121388;
X[32] = 4927; Y[32] = 123773;
X[33] = 5782; Y[33] = 125135;
X[34] = 6637; Y[34] = 126496;
X[35] = 8775; Y[35] = 126496;
X[36] = 13365; Y[36] = 126496;
X[37] = 16886; Y[37] = 116506;
X[38] = 20407; Y[38] = 106516;
X[39] = 20407; Y[39] = 70606;
X[40] = 20407; Y[40] = 65723;
var shX = X[9]*0.025;
for(var i = 0; i < 21; i++)
{
X[i] +=shX;
}
var shY = Y[24]*0.1692;
for(var i = 0; i < 21; i++)
{
Y[21+i] += shY;
}
return {X: X, Y: Y};
}
CIntegral.prototype.drawPath = function(pGraphics, XX, YY)
{
pGraphics._m(XX[0], YY[0]);
......@@ -1546,36 +1485,6 @@ CIntegral.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._c(XX[42], YY[42], XX[43], YY[43], XX[44], YY[44] );
}
CIntegral.prototype.old_drawPath = function(XX, YY)
{
MathControl.pGraph._m(XX[0], YY[0]);
MathControl.pGraph._l(XX[1], YY[1]);
MathControl.pGraph._c(XX[1], YY[1], XX[2], YY[2], XX[3], YY[3] );
MathControl.pGraph._c(XX[3], YY[3], XX[4], YY[4], XX[5], YY[5] );
MathControl.pGraph._c(XX[5], YY[5], XX[6], YY[6], XX[7], YY[7] );
MathControl.pGraph._c(XX[7], YY[7], XX[8], YY[8], XX[9], YY[9] );
MathControl.pGraph._l(XX[10], YY[10]);
MathControl.pGraph._l(XX[11], YY[11]);
MathControl.pGraph._c(XX[11], YY[11], XX[12], YY[12], XX[13], YY[13] );
MathControl.pGraph._c(XX[13], YY[13], XX[14], YY[14], XX[15], YY[15] );
MathControl.pGraph._c(XX[15], YY[15], XX[16], YY[16], XX[17], YY[17] );
MathControl.pGraph._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] );
MathControl.pGraph._l(XX[20], YY[20]);
MathControl.pGraph._l(XX[21], YY[21]);
MathControl.pGraph._c(XX[21], YY[21], XX[22], YY[22], XX[23], YY[23] );
MathControl.pGraph._c(XX[23], YY[23], XX[24], YY[24], XX[25], YY[25] );
MathControl.pGraph._c(XX[25], YY[25], XX[26], YY[26], XX[27], YY[27] );
MathControl.pGraph._c(XX[27], YY[27], XX[28], YY[28], XX[29], YY[29] );
MathControl.pGraph._l(XX[30], YY[30]);
MathControl.pGraph._l(XX[31], YY[31]);
MathControl.pGraph._c(XX[31], YY[31], XX[32], YY[32], XX[33], YY[33] );
MathControl.pGraph._c(XX[33], YY[33], XX[34], YY[34], XX[35], YY[35] );
MathControl.pGraph._c(XX[35], YY[35], XX[36], YY[36], XX[37], YY[37] );
MathControl.pGraph._c(XX[37], YY[37], XX[38], YY[38], XX[39], YY[39] );
MathControl.pGraph._l(XX[40], YY[40]);
}
CIntegral.prototype.calculateSizeGlyph = function()
{
......@@ -2017,7 +1926,7 @@ function CContourIntegral()
CNaryOperator.call(this);
}
Asc.extendClass(CContourIntegral, CNaryOperator);
CContourIntegral.prototype.draw = function(x, y, pGraphics)
CContourIntegral.prototype.draw = function(x, y, pGraphics, PDSE)
{
var circle = new CCircle();
var coord = circle.getCoord();
......@@ -2062,16 +1971,17 @@ CContourIntegral.prototype.draw = function(x, y, pGraphics)
var intGrid = pGraphics.GetIntegerGrid();
pGraphics.SetIntegerGrid(false);
//pGraphics.p_width(750);
pGraphics.p_width(penCircle);
pGraphics.b_color1(0,0,0, 255);
pGraphics.p_color(0,0,0, 255);
this.Parent.Make_ShdColor(PDSE, this.Parent.Get_CompiledCtrPrp());
//pGraphics.b_color1(0,0,0, 255);
//pGraphics.p_color(0,0,0, 255);
circle.drawPath(pGraphics, X, Y);
pGraphics.p_width(1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
integr.drawPath(pGraphics, XX, YY);
......@@ -2079,7 +1989,6 @@ CContourIntegral.prototype.draw = function(x, y, pGraphics)
pGraphics.df();
pGraphics.SetIntegerGrid(intGrid);
}
CContourIntegral.prototype.calculateSizeGlyph = function()
{
......@@ -2103,7 +2012,7 @@ function CSurfaceIntegral()
CNaryOperator.call(this);
}
Asc.extendClass(CSurfaceIntegral, CNaryOperator);
CSurfaceIntegral.prototype.draw = function(x, y, pGraphics)
CSurfaceIntegral.prototype.draw = function(x, y, pGraphics, PDSE)
{
var surf = new CSurface();
var coord = surf.getCoord();
......@@ -2150,13 +2059,14 @@ CSurfaceIntegral.prototype.draw = function(x, y, pGraphics)
pGraphics.p_width(penSurface);
pGraphics.b_color1(0,0,0, 255);
pGraphics.p_color(0,0,0, 255);
this.Parent.Make_ShdColor(PDSE, this.Parent.Get_CompiledCtrPrp());
//pGraphics.b_color1(0,0,0, 255);
//pGraphics.p_color(0,0,0, 255);
surf.drawPath(pGraphics, X, Y);
pGraphics.p_width(1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
integr.drawPath(pGraphics, XX, YY);
......@@ -2187,7 +2097,7 @@ function CVolumeIntegral()
CNaryOperator.call(this);
}
Asc.extendClass(CVolumeIntegral, CNaryOperator);
CVolumeIntegral.prototype.draw = function(x, y, pGraphics)
CVolumeIntegral.prototype.draw = function(x, y, pGraphics, PDSE)
{
var volume = new CVolume();
var coord = volume.getCoord();
......@@ -2233,13 +2143,14 @@ CVolumeIntegral.prototype.draw = function(x, y, pGraphics)
pGraphics.p_width(penVolume);
pGraphics.b_color1(0,0,0, 255);
pGraphics.p_color(0,0,0, 255);
this.Parent.Make_ShdColor(PDSE, this.Parent.Get_CompiledCtrPrp());
//pGraphics.b_color1(0,0,0, 255);
//pGraphics.p_color(0,0,0, 255);
volume.drawPath(pGraphics, X, Y);
pGraphics.p_width(1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
integr.drawPath(pGraphics, XX, YY);
......
......@@ -9,7 +9,6 @@ function CGlyphOperator()
this.stretch = 0;
this.bStretch = true;
this.MIN_AUG = 1;
this.penW = 1; // px
}
......@@ -33,10 +32,6 @@ CGlyphOperator.prototype.init = function(props)
this.turn = props.turn;
this.bStretch = (props.bStretch == true || props.bStretch == false) ? props.bStretch : true;
if(this.loc == LOCATION_TOP || this.loc == LOCATION_BOT)
this.MIN_AUG = 0.8;
else
this.MIN_AUG = 1;
}
CGlyphOperator.prototype.fixSize = function(stretch)
{
......@@ -383,16 +378,17 @@ CGlyphOperator.prototype.getCoordinateGlyph = function()
return {XX: XX, YY: YY, Width: glW, Height: glH};
}
CGlyphOperator.prototype.draw = function(pGraphics, XX, YY)
CGlyphOperator.prototype.draw = function(pGraphics, XX, YY, PDSE)
{
this.Parent.Make_ShdColor(PDSE);
var intGrid = pGraphics.GetIntegerGrid();
pGraphics.SetIntegerGrid(false);
pGraphics.p_width(this.penW*1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
this.drawPath(pGraphics, XX,YY);
this.drawPath(pGraphics, XX,YY, PDSE);
pGraphics.df();
pGraphics.SetIntegerGrid(intGrid);
......@@ -1487,8 +1483,9 @@ CWhiteSquareBracket.prototype.calcCoord = function(stretch)
return {XX: XX, YY: YY, W: W, H: H};
}
CWhiteSquareBracket.prototype.drawPath = function(pGraphics, XX, YY)
CWhiteSquareBracket.prototype.drawPath = function(pGraphics, XX, YY, PDSE)
{
pGraphics._m(XX[0], YY[0]);
pGraphics._l(XX[1], YY[1]);
pGraphics._l(XX[2], YY[2]);
......@@ -1500,7 +1497,8 @@ CWhiteSquareBracket.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._l(XX[8], YY[8]);
pGraphics.df();
pGraphics.b_color1(255,255,255, 255);
var BgColor = this.Parent.Make_ShdColor(PDSE);
pGraphics.b_color1(BgColor.r , BgColor.g , BgColor.b , 255);
pGraphics._s();
pGraphics._m(XX[9], YY[9]);
pGraphics._l(XX[10], YY[10]);
......@@ -1912,7 +1910,7 @@ CLR_DoubleArrow.prototype.calcCoord = function(stretch)
return {XX: XX, YY: YY, W: W, H: H};
}
CLR_DoubleArrow.prototype.drawPath = function(pGraphics, XX, YY)
CLR_DoubleArrow.prototype.drawPath = function(pGraphics, XX, YY, PDSE)
{
pGraphics._m(XX[0], YY[0]);
pGraphics._l(XX[1], YY[1]);
......@@ -1933,7 +1931,10 @@ CLR_DoubleArrow.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._l(XX[16], YY[16]);
pGraphics.df();
pGraphics.b_color1(255,255,255, 255);
var BgColor = this.Parent.Make_ShdColor(PDSE);
//pGraphics.b_color1(255,255,255, 255);
pGraphics.b_color1(BgColor.r , BgColor.g , BgColor.b , 255);
pGraphics._s();
pGraphics._m(XX[17], YY[17]);
pGraphics._l(XX[18], YY[18]);
......@@ -2931,12 +2932,12 @@ COperator.prototype.getProps = function(props, defaultProps)
return {loc: location, type: type, code: code};
}
COperator.prototype.draw = function(x, y, pGraphics)
COperator.prototype.draw = function(x, y, pGraphics, PDSE)
{
if(this.typeOper === OPERATOR_TEXT)
{
// выставляем font, если нужно отрисовать текст
pGraphics.b_color1(0,0,0,255);
//pGraphics.b_color1(0,0,0,255);
var ctrPrp = this.GetTPrpToControlLetter();
......@@ -2948,24 +2949,27 @@ COperator.prototype.draw = function(x, y, pGraphics)
Bold: false
};
pGraphics.SetFont(Font);
////////////////////////////////////////////////
this.operator.draw(x, y, pGraphics);
this.operator.draw(x, y, pGraphics, PDSE);
}
else
{
if(this.IsLineGlyph())
this.drawLines(x, y, pGraphics);
this.drawLines(x, y, pGraphics, PDSE);
else if(this.type === OPER_SEPARATOR)
this.drawSeparator(x, y, pGraphics);
this.drawSeparator(x, y, pGraphics, PDSE);
else
this.drawOperator(x, y, pGraphics);
this.drawOperator(x, y, pGraphics, PDSE);
}
}
COperator.prototype.drawOperator = function(absX, absY, pGraphics)
COperator.prototype.Make_ShdColor = function(PDSE)
{
return this.Parent.Make_ShdColor(PDSE, this.Parent.Get_CompiledCtrPrp());
}
COperator.prototype.drawOperator = function(absX, absY, pGraphics, PDSE)
{
if(this.typeOper !== OPERATOR_EMPTY)
{
......@@ -2982,10 +2986,10 @@ COperator.prototype.drawOperator = function(absX, absY, pGraphics)
Y.push(PosOper.y + absY + this.coordGlyph.YY[j]);
}
this.operator.draw(pGraphics, X, Y);
this.operator.draw(pGraphics, X, Y, PDSE);
}
}
COperator.prototype.drawSeparator = function(absX, absY, pGraphics)
COperator.prototype.drawSeparator = function(absX, absY, pGraphics, PDSE)
{
if(this.typeOper !== OPERATOR_EMPTY)
{
......@@ -3004,16 +3008,16 @@ COperator.prototype.drawSeparator = function(absX, absY, pGraphics)
Y.push(PosOper.y + absY + this.coordGlyph.YY[j]);
}
this.operator.draw(pGraphics, X, Y);
this.operator.draw(pGraphics, X, Y, PDSE);
}
}
}
COperator.prototype.drawLines = function(absX, absY, pGraphics)
COperator.prototype.drawLines = function(absX, absY, pGraphics, PDSE)
{
if(this.typeOper !== OPERATOR_EMPTY)
{
var PosOper = this.Positions[0];
this.operator.drawOnlyLines(PosOper.x + absX, PosOper.y + absY, pGraphics);
this.operator.drawOnlyLines(PosOper.x + absX, PosOper.y + absY, pGraphics, PDSE);
}
}
COperator.prototype.IsLineGlyph = function()
......@@ -3707,14 +3711,14 @@ CDelimiter.prototype.setPosition = function(position, PosInfo)
content.setPosition(PosContent); // CMathContent*/
}
CDelimiter.prototype.draw = function(x, y, pGraphics)
CDelimiter.prototype.draw = function(x, y, pGraphics, PDSE)
{
this.begOper.draw(x, y, pGraphics);
this.sepOper.draw(x, y, pGraphics);
this.endOper.draw(x, y, pGraphics);
this.begOper.draw(x, y, pGraphics, PDSE);
this.sepOper.draw(x, y, pGraphics, PDSE);
this.endOper.draw(x, y, pGraphics, PDSE);
for(var j = 0; j < this.nCol; j++)
this.elements[0][j].draw(x, y,pGraphics);
this.elements[0][j].draw(x, y,pGraphics, PDSE);
}
CDelimiter.prototype.align_2 = function(element)
{
......@@ -3808,9 +3812,9 @@ CCharacter.prototype.setPosition = function(pos, PosInfo)
this.operator.setPosition(PosOper);
}
}
CCharacter.prototype.draw = function(x, y, pGraphics)
CCharacter.prototype.draw = function(x, y, pGraphics, PDSE)
{
this.elements[0][0].draw(x, y, pGraphics);
this.elements[0][0].draw(x, y, pGraphics, PDSE);
var ctrPrp = this.GetTPrpToControlLetter();
......@@ -3824,10 +3828,10 @@ CCharacter.prototype.draw = function(x, y, pGraphics)
pGraphics.SetFont(Font);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
this.operator.draw(x, y, pGraphics);
//this.Make_ShdColor(PDSE, this.Get_CompiledCtrPrp());
this.operator.draw(x, y, pGraphics, PDSE);
}
CCharacter.prototype.getBase = function()
......
......@@ -113,7 +113,7 @@ CSignRadical.prototype.new_draw = function(x, y, pGraphics)
pGraphics.ds();
}
CSignRadical.prototype.draw = function(x, y, pGraphics)
CSignRadical.prototype.draw = function(x, y, pGraphics, PDSE)
{
var txtPrp = this.Parent.Get_CompiledCtrPrp();
//var txtPrp = this.Parent.getTxtPrp();
......@@ -179,8 +179,8 @@ CSignRadical.prototype.draw = function(x, y, pGraphics)
pGraphics.p_width(penW*0.8*1000);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
this.Parent.Make_ShdColor(PDSE, txtPrp);
//pGraphics.p_color(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
......@@ -638,10 +638,10 @@ CRadical.prototype.setPosition = function(pos, PosInfo)
this.RealBase.setPosition(PosBase, PosInfo);
}
}
CRadical.prototype.draw = function(x, y, pGraphics)
CRadical.prototype.draw = function(x, y, pGraphics, PDSE)
{
this.signRadical.draw(x, y, pGraphics);
CRadical.superclass.draw.call(this, x, y, pGraphics);
this.signRadical.draw(x, y, pGraphics, PDSE);
CRadical.superclass.draw.call(this, x, y, pGraphics, PDSE);
}
CRadical.prototype.getBase = 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