Commit 3400205e authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

1. тестовые формулы для редактирования

2. поправила баг с delimiters (не отрисовывались скобки)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52173 954022d7-b5bf-4e40-9824-e11837661b57
parent 7de2ea4e
...@@ -429,7 +429,7 @@ CControlComposition.prototype = ...@@ -429,7 +429,7 @@ CControlComposition.prototype =
} }
var MathControl = new CControlComposition(); var MathControl = new CControlComposition();
MathControl.AddComposition(); MathControl.AddComposition();
MathControl.SetPosition({x: 27.5 - 6, y: 25.3 }); MathControl.SetPosition({x: 21.5, y: 25.3 });
var inherit = function(obj, extObj) var inherit = function(obj, extObj)
{ {
......
...@@ -1462,8 +1462,9 @@ CDocument.prototype = ...@@ -1462,8 +1462,9 @@ CDocument.prototype =
nPageIndex = this.CurPage; nPageIndex = this.CurPage;
if(nPageIndex === 0) if(nPageIndex === 0)
MathComposition.Draw(pGraphics); MathComposition.Draw_2(21.5, 25.3, pGraphics);
//MathControl.Draw(pGraphics); //MathComposition.Draw(pGraphics);
//DrawUnion(); //DrawUnion();
......
...@@ -5927,16 +5927,18 @@ CMathComposition.prototype = ...@@ -5927,16 +5927,18 @@ CMathComposition.prototype =
this.Root.draw(pGraphics); this.Root.draw(pGraphics);
}, },
GetFirstPrp: function() Draw_2: function(x, y, pGraphics)
{ {
return this.Root.getFirstPrp(); if(this.Root.content.length > 1)
{
this.Root.setPosition({x: x, y: y});
this.Root.draw(pGraphics);
this.UpdateCursor();
}
}, },
Draw_2: function() GetFirstPrp: function()
{ {
this.Resize(); return this.Root.getFirstPrp();
this.UpdatePosition();
this.CheckTarget();
this.Draw();
}, },
Cursor_MoveRight: function() Cursor_MoveRight: function()
{ {
...@@ -6438,7 +6440,7 @@ CMathComposition.prototype = ...@@ -6438,7 +6440,7 @@ CMathComposition.prototype =
if(e.CtrlKey == true && e.KeyCode == 81) if(e.CtrlKey == true && e.KeyCode == 81)
{ {
simulatorRead(); simulatorMComposition(MATH_READ);
return false; return false;
} }
...@@ -6507,14 +6509,35 @@ CMathComposition.prototype = ...@@ -6507,14 +6509,35 @@ CMathComposition.prototype =
RecalculateComposition: function() RecalculateComposition: function()
{ {
//this.Root.setTxtPrp(this.TxtPrp); //this.Root.setTxtPrp(this.TxtPrp);
this.SetReferenceComposition(); //this.SetReferenceComposition();
this.Root.Resize(); this.Root.Resize();
this.Root.setPosition(this.pos); this.Root.setPosition(this.pos);
this.UpdateCursor(); this.UpdateCursor();
}, },
RecalculateComposition_2: function()
{
this.Root.Resize();
},
SetReferenceComposition: function() SetReferenceComposition: function()
{ {
this.Root.setReferenceComposition(this); this.Root.setReferenceComposition(this);
},
test_for_edit: function()
{
var props =
{
type: BAR_FRACTION
};
var fract = new CFraction();
addToContent_ForRead(MathComposition.Root, fract, props);
fract.getNumerator().addTxt("a");
fract.getDenominator().addTxt("b");
},
test_for_edit_2: function()
{
simulatorMComposition(MATH_EDIT);
} }
} }
...@@ -6589,3 +6612,19 @@ CRun.prototype = ...@@ -6589,3 +6612,19 @@ CRun.prototype =
} }
} }
function TEST_COMPOSITION()
{
//MathComposition.test_for_edit();
MathComposition.test_for_edit_2();
MathComposition.RecalculateComposition_2();
//MathComposition.Draw_2(x, y, )
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, { Width : Page_Width, Height : Page_Height, Margins : {
Left : X_Left_Field,
Right : X_Right_Field,
Top : Y_Top_Field,
Bottom : Y_Bottom_Field
} } );
}
...@@ -3970,14 +3970,14 @@ COperator.prototype.drawSeparator = function(pGraphics) ...@@ -3970,14 +3970,14 @@ COperator.prototype.drawSeparator = function(pGraphics)
{ {
var lng = this.coordGlyph.XX.length; var lng = this.coordGlyph.XX.length;
for(var i = 0; i < this.positions.length; i++) for(var i = 0; i < this.pos.length; i++)
{ {
var X = new Array(), var X = new Array(),
Y = new Array(); Y = new Array();
for(var j = 0; j < lng; j++) for(var j = 0; j < lng; j++)
{ {
X.push(this.positions[i].x + this.coordGlyph.XX[j]); X.push(this.pos[i].x + this.coordGlyph.XX[j]);
Y.push(this.positions[i].y + this.coordGlyph.YY[j]); Y.push(this.pos[i].y + this.coordGlyph.YY[j]);
} }
this.glyph.draw(pGraphics, X, Y); this.glyph.draw(pGraphics, X, Y);
...@@ -4127,7 +4127,7 @@ CDelimiter.prototype.init = function(props) ...@@ -4127,7 +4127,7 @@ CDelimiter.prototype.init = function(props)
this.endOper.init(props.endChr, props.endChrType, LOCATION_RIGHT); this.endOper.init(props.endChr, props.endChrType, LOCATION_RIGHT);
this.endOper.relate(this); this.endOper.relate(this);
this.endOper.init(props.sepChr, props.sepChrType, LOCATION_SEP); this.sepOper.init(props.sepChr, props.sepChrType, LOCATION_SEP);
this.sepOper.relate(this); this.sepOper.relate(this);
if(props.shape == DELIMITER_SHAPE_MATH || props.shp == DELIMITER_SHAPE_MATH) if(props.shape == DELIMITER_SHAPE_MATH || props.shp == DELIMITER_SHAPE_MATH)
......
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
<script type="text/javascript" src = "Math/drawingUnion.js"></script> <script type="text/javascript" src = "Math/drawingUnion.js"></script>
<script type="text/javascript" src = "Math/borderBox.js"></script> <script type="text/javascript" src = "Math/borderBox.js"></script>
<script type="text/javascript" src = "Math/test_for_read.js"></script> <script type="text/javascript" src = "Math/test_composition.js"></script>
<!----> <!---->
......
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