Commit 967c1578 authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

убрала Resize, setPosition и UpdatePosition (for Edit)


git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52813 954022d7-b5bf-4e40-9824-e11837661b57
parent 14481e06
...@@ -375,8 +375,6 @@ CControlComposition.prototype = ...@@ -375,8 +375,6 @@ CControlComposition.prototype =
CreateEquation: function(indef) CreateEquation: function(indef)
{ {
this.Content[this.CurPos].CreateEquation(indef); this.Content[this.CurPos].CreateEquation(indef);
this.Content[this.CurPos].RecalculateReverse(oMeasure);
this.Content[this.CurPos].UpdatePosition();
}, },
Paragraph_Add: function(TextPr) Paragraph_Add: function(TextPr)
{ {
...@@ -415,14 +413,6 @@ CControlComposition.prototype = ...@@ -415,14 +413,6 @@ CControlComposition.prototype =
{ {
this.Content[this.CurPos].Refresh(); this.Content[this.CurPos].Refresh();
}, },
old_Set_SelectionState: function(State)
{
this.Content[this.CurPos].Set_SelectionState(State);
},
old_Get_SelectionState: function()
{
return this.Content[this.CurPos].Get_SelectionState();
},
UpdateCursor: function() UpdateCursor: function()
{ {
this.Content[this.CurPos].UpdateCursor(); this.Content[this.CurPos].UpdateCursor();
...@@ -1268,7 +1258,7 @@ function Set_Container(dimension, path, index) ...@@ -1268,7 +1258,7 @@ function Set_Container(dimension, path, index)
document.getElementById("Container").style.display = "none"; document.getElementById("Container").style.display = "none";
// AddMathComponent -> CreateEquation // AddMathComponent -> CreateEquation
//MathControl.CreateEquation(index + _i*column + _j); //MathControl.CreateEquation(index + _i*column + _j);
MathComposition.CreateEquation(index + _i*column + _j); MathComposition.CreateEquation2(index + _i*column + _j);
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, { Width : Page_Width, Height : Page_Height, Margins : { editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, { Width : Page_Width, Height : Page_Height, Margins : {
Left : X_Left_Field, Left : X_Left_Field,
Right : X_Right_Field, Right : X_Right_Field,
......
...@@ -521,10 +521,6 @@ CMathBase.prototype = ...@@ -521,10 +521,6 @@ CMathBase.prototype =
return content; return content;
}, },
drawSelect: function()
{
this.elements[this.CurPos_X][this.CurPos_Y].drawSelect();
},
cursor_MoveToStartPos: function() // home => cursor_MoveToStartPos cursor_MoveToStartPos: function() // home => cursor_MoveToStartPos
{ {
this.CurPos_X = 0; this.CurPos_X = 0;
...@@ -873,11 +869,11 @@ CMathBase.prototype = ...@@ -873,11 +869,11 @@ CMathBase.prototype =
this.size = {width: _width, height: _height, center: _center}; this.size = {width: _width, height: _height, center: _center};
}, },
RecalculateReverse: function(oMeasure) /*RecalculateReverse: function(oMeasure)
{ {
this.recalculateSize(); this.recalculateSize();
this.Parent.RecalculateReverse(oMeasure); this.Parent.RecalculateReverse(oMeasure);
}, },*/
Resize: function(oMeasure) Resize: function(oMeasure)
{ {
for(var i=0; i < this.nRow; i++) for(var i=0; i < this.nRow; i++)
......
...@@ -1332,7 +1332,7 @@ CDocument.prototype = ...@@ -1332,7 +1332,7 @@ CDocument.prototype =
this.Document_UpdateRulersState(); this.Document_UpdateRulersState();
//** //**
//MathControl.UpdateCursor(); //MathControl.UpdateCursor();
MathComposition.UpdateCursor(); MathComposition.UpdateCursor2();
//this.RecalculateCurPos(); //this.RecalculateCurPos();
//** //**
//this.RecalculateCurPos(); //this.RecalculateCurPos();
......
...@@ -7,8 +7,6 @@ function CFraction() ...@@ -7,8 +7,6 @@ function CFraction()
extend(CFraction, CMathBase); extend(CFraction, CMathBase);
CFraction.prototype.init = function(props) CFraction.prototype.init = function(props)
{ {
if (props.type == undefined)
props.type = BAR_FRACTION;
var bValid = typeof(props.type) !== "undefined" && props.type !== null; var bValid = typeof(props.type) !== "undefined" && props.type !== null;
if(bValid) if(bValid)
...@@ -576,7 +574,7 @@ old_CBarFraction.prototype.setSimple = function(flag) ...@@ -576,7 +574,7 @@ old_CBarFraction.prototype.setSimple = function(flag)
else else
this.setReduct(1); this.setReduct(1);
this./**/Resize(); this.Resize();
} }
////////// //////////
......
...@@ -4412,20 +4412,7 @@ CMathContent.prototype = ...@@ -4412,20 +4412,7 @@ CMathContent.prototype =
this.update_widthContent(); /// !!!! this.update_widthContent(); /// !!!!
}, },
RecalculateReverse: function(oMeasure)
{
// for add component, set Txt Properties
var start = this.rInterval.startPos,
end = this.rInterval.endPos;
for(var i = start; i < end; i++)
this.content[i].value.Resize(oMeasure);
this.rInterval.startPos = this.rInterval.endPos = this.CurPos;
this.recalculateSize();
if(! this.bRoot )
this.Parent.RecalculateReverse(oMeasure);
},
Resize: function(oMeasure) // пересчитываем всю формулу Resize: function(oMeasure) // пересчитываем всю формулу
{ {
var bItalic = true; var bItalic = true;
...@@ -4437,7 +4424,7 @@ CMathContent.prototype = ...@@ -4437,7 +4424,7 @@ CMathContent.prototype =
if(type == MATH_TEXT) if(type == MATH_TEXT)
{ {
this.content[i].value.setMText(bItalic); this.content[i].value.setMText(bItalic);
this.content[i].value.resize(oMeasure); this.content[i].value.Resize(oMeasure);
} }
else if(type == MATH_COMP) else if(type == MATH_COMP)
{ {
...@@ -4468,7 +4455,7 @@ CMathContent.prototype = ...@@ -4468,7 +4455,7 @@ CMathContent.prototype =
txtPrp.Italic = false; txtPrp.Italic = false;
g_oTextMeasurer.SetFont(txtPrp); g_oTextMeasurer.SetFont(txtPrp);
this.content[i].value.resize(oMeasure); this.content[i].value.Resize(oMeasure);
} }
} }
} }
...@@ -5079,44 +5066,6 @@ CMathContent.prototype = ...@@ -5079,44 +5066,6 @@ CMathContent.prototype =
this.drawSelect(); this.drawSelect();
} }
}, },
//TODO
//переделать
old_drawSelect: function()
{
var start = this.selection.startPos;
var end = this.selection.endPos ;
if( start > end)
{
var tmp = start;
start = end;
end = tmp;
}
var widthSelect = 0;
try
{
for(var j = start; j < end ; j++)
widthSelect += this.content[j].widthToEl - this.content[j-1].widthToEl;
}
catch(e)
{
//console.log("Don't work update_widthContent");
console.log("Don't work drawSelect");
}
if( widthSelect != 0)
{
editor.WordControl.m_oLogicDocument.DrawingDocument.SelectClear(); // "обнуляем" логический селект
editor.WordControl.m_oLogicDocument.DrawingDocument.SelectEnabled(true); // select
/// ...Selectenabled(false) deselect, убираем слой
//editor.WordControl.m_oLogicDocument.DrawingDocument.TargetEnd();
//editor.WordControl.m_oLogicDocument.DrawingDocument.AddPageSelection(0,this.pos.x + this.content[start-1].widthToEl, this.pos.y, widthSelect, heightSelect );
editor.WordControl.m_oLogicDocument.DrawingDocument.SelectShow();
//editor.WordControl.m_oLogicDocument.DrawingDocument.TargetStart();
}
},
IsPlaceholder: function() IsPlaceholder: function()
{ {
var flag = false; var flag = false;
...@@ -5168,7 +5117,7 @@ CMathContent.prototype = ...@@ -5168,7 +5117,7 @@ CMathContent.prototype =
this.content[i].value.setPosition(t); this.content[i].value.setPosition(t);
} }
}, },
drawSelect2: function() drawSelect: function()
{ {
var start = this.RealSelect.startPos, var start = this.RealSelect.startPos,
end = this.RealSelect.endPos; end = this.RealSelect.endPos;
...@@ -6061,6 +6010,26 @@ CMathContent.prototype = ...@@ -6061,6 +6010,26 @@ CMathContent.prototype =
//this.selection.active = false; //this.selection.active = false;
} }
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
//// test function for me ////
/*RecalculateReverse: function(oMeasure)
{
// for add component, set Txt Properties
var start = this.rInterval.startPos,
end = this.rInterval.endPos;
for(var i = start; i < end; i++)
this.content[i].value.Resize(oMeasure);
this.rInterval.startPos = this.rInterval.endPos = this.CurPos;
this.recalculateSize();
if(! this.bRoot )
this.Parent.RecalculateReverse(oMeasure);
},*/
//////////////* end of test functions *//////////////////
} }
//todo //todo
//разобраться с gaps //разобраться с gaps
...@@ -6093,226 +6062,301 @@ CMathComposition.prototype = ...@@ -6093,226 +6062,301 @@ CMathComposition.prototype =
// сделать глобальную булевскую переменную для того, чтобы запоминать нужен пересчет контента или нет // сделать глобальную булевскую переменную для того, чтобы запоминать нужен пересчет контента или нет
// необходима тк на backspace может не быть реального удаления переменных, а только селект // необходима тк на backspace может не быть реального удаления переменных, а только селект
Init: function() //// test function for me ////
TestSetPosition: function()
{ {
// TODO this.Root.setPosition(this.posCompos);
// переделать gaps
//var g_Unif = 6*g_dKoef_pix_to_mm;
var g_Unif = 0;
var gps = new dist(g_Unif, g_Unif, g_Unif, g_Unif);
this.Root = new CMathContent();
this.Root.g_mContext = gps;
this.Root.setComposition(this);
//this.SetTestRunPrp();
//this.Root.setTxtPrp(this.TxtPrp);
this.CurrentContent = this.Root;
this.SelectContent = this.Root;
this.Root.relate(-1); // корень
}, },
/*SetTestRunPrp: function() TestSetFontAllSymbols: function(font)
{
var runPrp = new CTextPr();
runPrp.Merge(this.DefaultTxtPrp);
this.Root.addRunPrp(runPrp);
},*/
GetTxtPrp: function()
{ {
return this.DefaultTxtPrp; this.Root.setFont(font);
}, },
//TODO CheckTarget: function()
// переделать Draw (для режима редактирования передавать координату для отрисовки формулы) !!
// position вычислить естественно до того, как придет Draw, чтобы не пришлось пересчитывать при изменении в тексте документа
Draw_2: function(pGraphics)
{ {
if(this.Root.content.length > 1) var bSelect = this.SelectContent.selectUse(),
{ bTarget = this.SelectContent.IsPlaceholder(),
var w_Box = this.Root.size.width; bHideTgt = this.SelectContent.plhHide;
var h_Box = this.Root.size.height;
pGraphics.p_color(224, 238, 224, 255); // "p_color" for stroke
// "b_color1" for fill
//context.b_color1(224, 238, 230, 255);
pGraphics.drawHorLine(0, this.pos.y, this.pos.x, this.pos.x + w_Box, 0.2); if(bTarget)
pGraphics.drawHorLine(0, this.pos.y + h_Box, this.pos.x, this.pos.x + w_Box, 0.2); {
pGraphics.drawVerLine(0,this.pos.x, this.pos.y, this.pos.y + h_Box, 0.2 ); if(!bHideTgt)
pGraphics.drawVerLine(0,this.pos.x + w_Box, this.pos.y, this.pos.y + h_Box, 0.2 ); {
this.SelectContent.tgtSelect();
this.HideCursor();
}
else
{
this.SelectContent.setPositionHideTgt();
this.ShowCursor();
}
} }
else if(bSelect)
this.Root.draw(pGraphics); this.HideCursor();
}, else
Draw: function(x, y, pGraphics)
{
if(this.Root.content.length > 1)
{ {
this.pos = {x: x, y: y - this.Root.size.center}; this.ShowCursor();
this.Root.setPosition({x: x, y: y - this.Root.size.center});
this.Root.draw(pGraphics);
//this.UpdateCursor();
} }
this.CurrentContent.update_Cursor();
}, },
GetFirstPrp: function() Cursor_MoveRight_2: function()
{
return this.Root.getFirstPrp();
},
Cursor_MoveLeft: function()
{ {
var move = this.SelectContent.cursor_moveLeft(); this.ClearSelect();
var move = this.SelectContent.cursor_moveRight();
//передаем состояние, т.к. можем выйти за пределы формулы
if(move.state) if(move.state)
{ {
// SelectContent == CurrentContent
this.SelectContent = move.SelectContent; this.SelectContent = move.SelectContent;
this.CurrentContent = move.CurrContent; this.CurrentContent = move.CurrContent;
this.CheckTarget();
} }
return move.state; return move.state;
}, },
Cursor_MoveRight: function() Cursor_MoveLeft_2: function()
{ {
var move = this.SelectContent.cursor_moveRight(); this.ClearSelect();
var move = this.SelectContent.cursor_moveLeft();
//передаем состояние, т.к. можем выйти за пределы формулы
if(move.state) if(move.state)
{ {
this.SelectContent = move.SelectContent; this.SelectContent = move.SelectContent;
this.CurrentContent = move.CurrContent; this.CurrentContent = move.CurrContent;
this.CheckTarget();
} }
return move.state; return move.state;
}, },
Cursor_MoveUp: function() Cursor_MoveUp_2: function()
{ {
//TODO !!! //TODO !!!
//сделать как в Cursor_MoveLeft/Right //сделать как в Cursor_MoveLeft/Right
// в зависимости от пришедшего флага выставлять/не выставлять контент // в зависимости от пришедшего флага выставлять/не выставлять контент
this.ClearSelect();
var move = this.SelectContent.cursor_moveUp(); var move = this.SelectContent.cursor_moveUp();
this.CurrentContent = move.CurrContent; this.CurrentContent = move.CurrContent;
this.SelectContent = move.SelectContent; this.SelectContent = move.SelectContent;
return move.state; this.CheckTarget();
},
Cursor_MoveDown: function()
{
var move = this.SelectContent.cursor_moveDown();
this.CurrentContent = move.CurrContent;
this.SelectContent = move.SelectContent;
return move.state; return move.state;
}, },
Cursor_MoveToStartPos: function() OnKeyDown: function(e)
{
this.Root.cursor_MoveToStartPos();
this.CurrentContent = this.SelectContent = this.Root;
},
Cursor_MoveToEndPos: function()
{
this.Root.cursor_MoveToEndPos();
this.CurrentContent = this.SelectContent = this.Root;
},
getSize: function()
{ {
/*return this.Root.size;*/ //стрелка вверх
if(e.KeyCode==38)
//
var sh = 0.2487852283770651*g_oTextMeasurer.GetHeight();
//
var size =
{ {
Width: this.Root.size.width, this.Cursor_MoveUp_2();
WidthVisible: this.Root.size.width,
Height: this.Root.size.height,
Ascent: this.Root.size.center + sh,
Descent: this.Root.size.height - this.Root.size.center
};
return size;
},
Remove: function(order, bOnAdd)
{
////* History */////
History.Create_NewPoint();
/*var start = this.SelectContent.selection.startPos,
end = this.SelectContent.selection.endPos;*/
var start = this.SelectContent.RealSelect.startPos,
end = this.SelectContent.RealSelect.endPos;
var Pos;
if(start !== end)
Pos = start < end ? start: end;
else if(order == 1)
Pos = this.SelectContent.CurPos;
else
Pos = this.SelectContent.CurPos + 1;
///////////////////////////
var removeMComp = true; return true;
}
//стрелка вниз
else if(e.KeyCode==40)
{
this.Cursor_MoveDown_2();
if(bOnAdd) return true;
}
//стрелка влево
if(e.KeyCode==37)
{ {
this.SelectContent.removeAreaSelect(); this.Cursor_MoveLeft_2();
return true;
} }
else //стрелка вправо
else if(e.KeyCode==39)
{ {
var result = this.SelectContent.remove(order); this.Cursor_MoveRight_2();
var bRoot = this.SelectContent.bRoot === true, return true;
bToUpper = result.state.bBegin || result.state.bEnd; // наверх нужно ли прокидовать }
//backspace
else if(e.KeyCode==8)
{
try
{
if(this.Remove_2(1))
{
//this.UpdatePosition();
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, editor.WordControl.m_oLogicDocument.Pages[0]);
}
}
catch(e)
{
if( result.state.bDelete ) }
History.Add(this.CurrentContent, {Type: historyitem_Math_RemoveItem, Items: result.items, Pos: Pos});
return true;
}
//delete
else if ( e.KeyCode == 46)
{
if(this.Remove_2(-1))
{
//this.UpdatePosition();
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, editor.WordControl.m_oLogicDocument.Pages[0]);
this.CurrentContent = result.CurrContent; }
this.SelectContent = result.SelectContent; }
this.CurrentContent.setPlaceholderAfterRemove(); // чтобы не выставлялся тагет при вставке, когда заселекчен весь контент и мы добавляем, например, другой мат элемент
removeMComp = !(bRoot && bToUpper); // посылаем false, если в начале + backspace или в конце + delete if(e.CtrlKey == true && e.KeyCode == 81)
{
simulatorMComposition(this, MATH_READ);
return false;
} }
return removeMComp; return false;
}, },
OnKeyPress: function(e)
UpdatePosition: function()
{ {
this.Root.setPosition(this.pos); var code = e.CharCode;
//
/*if(code == 42)
code = 8727;
else if(code == 45)
code = 8722;
else if(code == 37)
code = 0x222B;
else if(code==94)
code = 0x2211;
if(code == 0x0068)
code = 0x210E;*/
/*else if(code > 0x0040 && code < 0x005B)
code = code + 0x1D3F3;
else if(code > 0x0060 && code < 0x007b)
code = code + 0x1D3ED;*/
if(code>=0x0020 )
{
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, editor.WordControl.m_oLogicDocument.Pages[0]);
this.AddLetter_2(code);
return true;
}
return false;
}, },
SetPosition: function(pos) OnMouseDown: function(x,y)
{ {
this.pos = pos; var coord = this.GetCoordComp(x,y);
this.Root.setPosition(this.pos);
if( this.IsRect(coord.x, coord.y) )
this.MouseDown(coord.x, coord.y);
},
OnMouseMove: function(x,y)
{
var coord = this.GetCoordComp(x,y);
if( this.IsRect(coord.x, coord.y) )
this.MouseMove(coord.x, coord.y);
}, },
RecalculateReverse: function(oMeasure) // for edit OnMouseUp: function()
{ {
this.SelectContent.RecalculateReverse(oMeasure); this.MouseUp();
}, },
Resize: function(oMeasure) MouseDown: function(mouseX, mouseY)
{
this.ClearSelect();
this.CurrentContent = this.SelectContent = this.Root.mouseDown({x: mouseX, y: mouseY}, -1);
this.TEST_SELECT_ACTIVE = true;
this.CheckTarget();
},
MouseMove: function(mouseX, mouseY)
{
if(this.TEST_SELECT_ACTIVE)
{
this.ClearSelect();
var movement = this.Root.mouseMove({x: mouseX, y: mouseY});
this.SelectContent = movement.SelectContent;
this.CheckTarget();
}
},
MouseUp: function()
{
this.TEST_SELECT_ACTIVE = false;
},
Remove_2: function(order)
{
if(TEST)
{
History.Create_NewPoint();
/*var start = this.SelectContent.selection.startPos,
end = this.SelectContent.selection.endPos;*/
var start = this.SelectContent.RealSelect.startPos,
end = this.SelectContent.RealSelect.endPos;
var Pos;
if(start !== end)
Pos = start < end ? start: end;
else if(order == 1)
Pos = this.SelectContent.CurPos;
else
Pos = this.SelectContent.CurPos + 1;
}
this.ClearSelect();
var result = this.SelectContent.remove(order);
this.CurrentContent = result.CurrContent;
this.SelectContent = result.SelectContent;
this.CurrentContent.setPlaceholderAfterRemove(); // чтобы не выставлялся тагет при вставке, когда заселекчен весь контент и мы добавляем, например, другой мат элемент
if( result.state.bDelete )
{
if(TEST)
{
History.Add(this.CurrentContent, {Type: historyitem_Math_RemoveItem, Items: result.items, Pos: Pos});
}
// временно
//this.CurrentContent.RecalculateReverse();
this.Resize(g_oTextMeasurer);
this.UpdatePosition();
}
this.CheckTarget();
return result.state.bDelete;
},
RecalculateComposition_2: function(oMeasure)
{ {
//this.SetReferenceComposition();
this.Root.Resize(oMeasure); this.Root.Resize(oMeasure);
this.Root.setPosition(this.pos);
this.UpdateCursor();
}, },
AddLetter: function(code) AddLetter_2: function(code)
{ {
if(TEST) if(TEST)
{ {
History.Create_NewPoint(); History.Create_NewPoint();
} }
//this.ClearSelect(); this.ClearSelect();
//this.SelectContent.removeAreaSelect(); this.SelectContent.removeAreaSelect();
/*if(this.Root.IsEmpty()) /*if(this.Root.IsEmpty())
this.Root.addRunPrp(this.DefaultTxtPrp);*/ this.Root.addRunPrp(this.DefaultTxtPrp);*/
var items = this.SelectContent.addLetter(code); var items = this.SelectContent.addLetter(code);
...@@ -6340,63 +6384,41 @@ CMathComposition.prototype = ...@@ -6340,63 +6384,41 @@ CMathComposition.prototype =
}, },
CreateEquation2: function(indef) CreateEquation2: function(indef)
{ {
if(TEST) this.CreateEquation(indef);
{
History.Create_NewPoint();
}
//this.ClearSelect();
//this.SelectContent.removeAreaSelect();
if(TEST)
var Pos = this.SelectContent.CurPos + 1;
var items = this.SelectContent.createEquation(indef);
///
// временно // временно
//this.RecalculateReverse(); //this.RecalculateReverse();
//this.Root.Resize(); //this.Root.Resize();
this.Resize(g_oTextMeasurer); this.Resize(g_oTextMeasurer);
this.UpdatePosition(); this.UpdatePosition();
///
if(TEST)
{
//var Pos = this.SelectContent.CurPos - 1,
var EndPos = this.SelectContent.CurPos + 1;
History.Add(this.CurrentContent, {Type: historyitem_Math_AddItem, Items: items, Pos: Pos, PosEnd: EndPos});
}
this.CurrentContent = this.SelectContent;
this.CurrentContent.update_Cursor();
this.ShowCursor();
}, },
Get_SelectionState : function() UpdateCursor2: function()
{ {
var State = new Object(); //this.CurrentContent.update_Cursor();
this.SelectContent.update_Cursor();
var stackCurrent = new Array(); if( this.SelectContent.selectUse())
this.CurrentContent.getStackPositions( stackCurrent ); this.HideCursor();
State.Current = else
{ this.ShowCursor();
stack: stackCurrent
};
var stackSelect = new Array();
this.SelectContent.getStackPositions( stackSelect );
State.Select =
{
StartSelect: this.SelectContent.RealSelect.startPos - 1,
EndSelect: this.SelectContent.RealSelect.endPos - 1,
stack: stackSelect
};
return State;
}, },
Set_SelectionState : function(State) HideCursor: function()
{
editor.WordControl.m_oLogicDocument.DrawingDocument.TargetEnd();
},
ShowCursor: function()
{
//узнать зачем обе функции вызывать
editor.WordControl.m_oLogicDocument.DrawingDocument.TargetStart();
editor.WordControl.m_oLogicDocument.DrawingDocument.TargetShow();
},
old_SetTxtPrp: function(txtPrp)
{
this.SelectContent.changeTxtPrp(txtPrp, false);
//this.SelectContent.setTxtPrp(txtPrp, false);
this.Resize();
this.UpdatePosition();
this.UpdateCursor();
},
Set_SelectionState_2 : function(State)
{ {
this.ClearSelect(); this.ClearSelect();
// временно // временно
...@@ -6412,21 +6434,20 @@ CMathComposition.prototype = ...@@ -6412,21 +6434,20 @@ CMathComposition.prototype =
this.CurrentContent = this.Root.getContent( stackCurrent, true ); this.CurrentContent = this.Root.getContent( stackCurrent, true );
/*if(this.SelectContent.IsPlaceholder()) /*if(this.SelectContent.IsPlaceholder())
this.CheckTarget(); this.CheckTarget();
else if( State.Select.StartSelect !== State.Select.EndSelect ) else if( State.Select.StartSelect !== State.Select.EndSelect )
{ {
this.SelectContent.setStart_Selection(State.Select.StartSelect ); this.SelectContent.setStart_Selection(State.Select.StartSelect );
this.SelectContent.setEnd_Selection(State.Select.EndSelect); this.SelectContent.setEnd_Selection(State.Select.EndSelect);
//this.SelectContent.selection.active = false; //this.SelectContent.selection.active = false;
} }
else else
{ {
this.SelectContent.setStart_Selection(State.Select.StartSelect - 1); this.SelectContent.setStart_Selection(State.Select.StartSelect - 1);
//this.SelectContent.selection.active = false; //this.SelectContent.selection.active = false;
this.UpdateCursor(); this.UpdateCursor();
}*/ }*/
}, },
ClearSelect: function() ClearSelect: function()
{ {
if(this.SelectContent.selectUse()) if(this.SelectContent.selectUse())
...@@ -6435,371 +6456,275 @@ CMathComposition.prototype = ...@@ -6435,371 +6456,275 @@ CMathComposition.prototype =
editor.WordControl.m_oLogicDocument.DrawingDocument.SelectEnabled(false); editor.WordControl.m_oLogicDocument.DrawingDocument.SelectEnabled(false);
} }
}, },
old_SetTxtPrp: function(txtPrp) Draw_2: function(pGraphics)
{ {
this.SelectContent.changeTxtPrp(txtPrp, false); if(this.Root.content.length > 1)
//this.SelectContent.setTxtPrp(txtPrp, false); {
this.Resize(); var w_Box = this.Root.size.width;
this.UpdatePosition(); var h_Box = this.Root.size.height;
this.UpdateCursor();
pGraphics.p_color(224, 238, 224, 255); // "p_color" for stroke
// "b_color1" for fill
//context.b_color1(224, 238, 230, 255);
pGraphics.drawHorLine(0, this.pos.y, this.pos.x, this.pos.x + w_Box, 0.2);
pGraphics.drawHorLine(0, this.pos.y + h_Box, this.pos.x, this.pos.x + w_Box, 0.2);
pGraphics.drawVerLine(0,this.pos.x, this.pos.y, this.pos.y + h_Box, 0.2 );
pGraphics.drawVerLine(0,this.pos.x + w_Box, this.pos.y, this.pos.y + h_Box, 0.2 );
}
this.Root.draw(pGraphics);
}, },
UpdateCursor: function() UpdatePosition: function()
{ {
//this.CurrentContent.update_Cursor(); this.Root.setPosition(this.pos);
this.SelectContent.update_Cursor();
/*if( this.SelectContent.selection.startPos !== this.SelectContent.selection.endPos)
this.HideCursor();
else
this.ShowCursor();*/
}, },
/*GetPrpSelectContent: function() SetPosition: function(pos)
{
return this.SelectContent.getSelectTPrp(true);
},*/
//// test function ////
TestSetPosition: function()
{ {
this.Root.setPosition(this.posCompos); this.pos = pos;
this.Root.setPosition(this.pos);
}, },
TestSetFontAllSymbols: function(font) IsRect: function(x, y)
{ {
this.Root.setFont(font); var size = this.Root.size;
return ( x > 0 && x < size.width && y > 0 && y < size.height);
}, },
CheckTarget: function() GetCoordComp: function(x, y)
{ {
var bSelect = this.SelectContent.selectUse(), var _x = x - this.pos.x;
bTarget = this.SelectContent.IsPlaceholder(), var _y = y - this.pos.y;
bHideTgt = this.SelectContent.plhHide;
if(bTarget)
{
if(!bHideTgt)
{
this.SelectContent.tgtSelect();
this.HideCursor();
}
else
{
this.SelectContent.setPositionHideTgt();
this.ShowCursor();
}
}
else if(bSelect)
this.HideCursor();
else
{
this.ShowCursor();
}
this.CurrentContent.update_Cursor(); return {x: _x, y: _y};
}, },
Cursor_MoveRight_2: function() Resize: function(oMeasure)
{ {
this.ClearSelect(); this.Root.Resize(oMeasure);
var move = this.SelectContent.cursor_moveRight();
//передаем состояние, т.к. можем выйти за пределы формулы
if(move.state)
{
// SelectContent == CurrentContent
this.SelectContent = move.SelectContent;
this.CurrentContent = move.CurrContent;
this.CheckTarget();
}
return move.state;
}, },
Cursor_MoveLeft_2: function() test_for_edit: function()
{ {
this.ClearSelect(); var props =
var move = this.SelectContent.cursor_moveLeft();
if(move.state)
{ {
this.SelectContent = move.SelectContent; type: BAR_FRACTION
this.CurrentContent = move.CurrContent; };
var fract = new CFraction();
this.CheckTarget(); addToContent_ForRead(this.Root, fract, props);
}
return move.state; fract.getNumerator().addTxt("a");
fract.getDenominator().addTxt("b");
}, },
Cursor_MoveUp_2: function() test_for_edit_2: function()
{ {
//TODO !!! simulatorMComposition(this, MATH_EDIT);
//сделать как в Cursor_MoveLeft/Right
// в зависимости от пришедшего флага выставлять/не выставлять контент
this.ClearSelect();
var move = this.SelectContent.cursor_moveUp();
this.CurrentContent = move.CurrContent;
this.SelectContent = move.SelectContent;
this.CheckTarget();
return move.state;
}, },
OnKeyDown: function(e) /*RecalculateReverse: function(oMeasure) // for edit
{ {
//стрелка вверх this.SelectContent.RecalculateReverse(oMeasure);
if(e.KeyCode==38) },*/
{ //////////////* end of test functions *//////////////////
this.Cursor_MoveUp_2();
return true;
}
//стрелка вниз
else if(e.KeyCode==40)
{
this.Cursor_MoveDown_2();
return true; Init: function()
} {
//стрелка влево // TODO
if(e.KeyCode==37) // переделать gaps
{ //var g_Unif = 6*g_dKoef_pix_to_mm;
this.Cursor_MoveLeft_2(); var g_Unif = 0;
var gps = new dist(g_Unif, g_Unif, g_Unif, g_Unif);
return true;
}
//стрелка вправо
else if(e.KeyCode==39)
{
this.Cursor_MoveRight_2();
return true;
}
//backspace
else if(e.KeyCode==8)
{
try
{
if(this.Remove_2(1))
{
//this.UpdatePosition();
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, editor.WordControl.m_oLogicDocument.Pages[0]);
}
}
catch(e)
{
} this.Root = new CMathContent();
this.Root.g_mContext = gps;
this.Root.setComposition(this);
//this.SetTestRunPrp();
//this.Root.setTxtPrp(this.TxtPrp);
return true; this.CurrentContent = this.Root;
} this.SelectContent = this.Root;
//delete
else if ( e.KeyCode == 46)
{
if(this.Remove_2(-1))
{
//this.UpdatePosition();
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, editor.WordControl.m_oLogicDocument.Pages[0]);
} this.Root.relate(-1); // корень
} },
/*SetTestRunPrp: function()
{
var runPrp = new CTextPr();
runPrp.Merge(this.DefaultTxtPrp);
if(e.CtrlKey == true && e.KeyCode == 81) this.Root.addRunPrp(runPrp);
},*/
GetTxtPrp: function()
{
return this.DefaultTxtPrp;
},
//TODO
// position вычислить естественно до того, как придет Draw, чтобы не пришлось пересчитывать при изменении в тексте документа
Draw: function(x, y, pGraphics)
{
if(this.Root.content.length > 1)
{ {
simulatorMComposition(this, MATH_READ); this.pos = {x: x, y: y - this.Root.size.center};
return false; this.Root.setPosition({x: x, y: y - this.Root.size.center});
this.Root.draw(pGraphics);
} }
return false;
}, },
OnKeyPress: function(e) GetFirstPrp: function()
{ {
var code = e.CharCode; return this.Root.getFirstPrp();
},
// Cursor_MoveLeft: function()
/*if(code == 42) {
code = 8727; var move = this.SelectContent.cursor_moveLeft();
else if(code == 45)
code = 8722;
else if(code == 37)
code = 0x222B;
else if(code==94)
code = 0x2211;
if(code == 0x0068)
code = 0x210E;*/
/*else if(code > 0x0040 && code < 0x005B)
code = code + 0x1D3F3;
else if(code > 0x0060 && code < 0x007b)
code = code + 0x1D3ED;*/
if(code>=0x0020 )
{
editor.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(0, editor.WordControl.m_oLogicDocument.Pages[0]);
this.AddLetter(code);
return true; if(move.state)
{
this.SelectContent = move.SelectContent;
this.CurrentContent = move.CurrContent;
} }
return move.state;
return false;
}, },
OnMouseDown: function(x,y) Cursor_MoveRight: function()
{ {
var coord = this.GetCoordComp(x,y); var move = this.SelectContent.cursor_moveRight();
if( this.IsRect(coord.x, coord.y) ) //передаем состояние, т.к. можем выйти за пределы формулы
this.MouseDown(coord.x, coord.y); if(move.state)
}, {
OnMouseMove: function(x,y) this.SelectContent = move.SelectContent;
{ this.CurrentContent = move.CurrContent;
var coord = this.GetCoordComp(x,y); }
if( this.IsRect(coord.x, coord.y) ) return move.state;
this.MouseMove(coord.x, coord.y);
},
OnMouseUp: function()
{
this.MouseUp();
}, },
MouseDown: function(mouseX, mouseY) Cursor_MoveUp: function()
{ {
this.ClearSelect(); //TODO !!!
this.CurrentContent = this.SelectContent = this.Root.mouseDown({x: mouseX, y: mouseY}, -1); //сделать как в Cursor_MoveLeft/Right
// в зависимости от пришедшего флага выставлять/не выставлять контент
this.TEST_SELECT_ACTIVE = true; var move = this.SelectContent.cursor_moveUp();
this.CheckTarget(); this.CurrentContent = move.CurrContent;
this.SelectContent = move.SelectContent;
return move.state;
}, },
MouseMove: function(mouseX, mouseY) Cursor_MoveDown: function()
{ {
if(this.TEST_SELECT_ACTIVE) var move = this.SelectContent.cursor_moveDown();
{
this.ClearSelect();
var movement = this.Root.mouseMove({x: mouseX, y: mouseY}); this.CurrentContent = move.CurrContent;
this.SelectContent = movement.SelectContent; this.SelectContent = move.SelectContent;
this.CheckTarget(); return move.state;
}
}, },
MouseUp: function() Cursor_MoveToStartPos: function()
{ {
this.TEST_SELECT_ACTIVE = false; this.Root.cursor_MoveToStartPos();
this.CurrentContent = this.SelectContent = this.Root;
}, },
Remove_2: function(order) Cursor_MoveToEndPos: function()
{ {
if(TEST) this.Root.cursor_MoveToEndPos();
this.CurrentContent = this.SelectContent = this.Root;
},
getSize: function()
{
/*return this.Root.size;*/
//
var sh = 0.2487852283770651*g_oTextMeasurer.GetHeight();
//
var size =
{ {
History.Create_NewPoint(); Width: this.Root.size.width,
/*var start = this.SelectContent.selection.startPos, WidthVisible: this.Root.size.width,
end = this.SelectContent.selection.endPos;*/ Height: this.Root.size.height,
var start = this.SelectContent.RealSelect.startPos, Ascent: this.Root.size.center + sh,
end = this.SelectContent.RealSelect.endPos; Descent: this.Root.size.height - this.Root.size.center
var Pos; };
if(start !== end) return size;
Pos = start < end ? start: end; },
else if(order == 1) Remove: function(order, bOnAdd)
Pos = this.SelectContent.CurPos; {
else ////* History */////
Pos = this.SelectContent.CurPos + 1; History.Create_NewPoint();
}
this.ClearSelect(); var start = this.SelectContent.RealSelect.startPos,
end = this.SelectContent.RealSelect.endPos;
var Pos;
var result = this.SelectContent.remove(order); if(start !== end)
this.CurrentContent = result.CurrContent; Pos = start < end ? start: end;
this.SelectContent = result.SelectContent; else if(order == 1)
Pos = this.SelectContent.CurPos;
else
Pos = this.SelectContent.CurPos + 1;
this.CurrentContent.setPlaceholderAfterRemove(); // чтобы не выставлялся тагет при вставке, когда заселекчен весь контент и мы добавляем, например, другой мат элемент ///////////////////////////
if( result.state.bDelete ) var removeMComp = true;
if(bOnAdd)
{ {
if(TEST) this.SelectContent.removeAreaSelect();
{ }
else
{
var result = this.SelectContent.remove(order);
var bRoot = this.SelectContent.bRoot === true,
bToUpper = result.state.bBegin || result.state.bEnd; // наверх нужно ли прокидовать
if( result.state.bDelete )
History.Add(this.CurrentContent, {Type: historyitem_Math_RemoveItem, Items: result.items, Pos: Pos}); History.Add(this.CurrentContent, {Type: historyitem_Math_RemoveItem, Items: result.items, Pos: Pos});
}
// временно
//this.CurrentContent.RecalculateReverse();
this.Resize(g_oTextMeasurer);
this.UpdatePosition();
}
this.CheckTarget(); this.CurrentContent = result.CurrContent;
this.SelectContent = result.SelectContent;
this.CurrentContent.setPlaceholderAfterRemove(); // чтобы не выставлялся тагет при вставке, когда заселекчен весь контент и мы добавляем, например, другой мат элемент
removeMComp = !(bRoot && bToUpper); // посылаем false, если в начале + backspace или в конце + delete
}
return result.state.bDelete; return removeMComp;
}, },
RecalculateComposition_2: function(oMeasure) AddLetter: function(code)
{ {
//this.SetReferenceComposition(); History.Create_NewPoint();
this.Root.Resize(oMeasure); var items = this.SelectContent.addLetter(code);
this.Root.setPosition(this.pos); this.CurrentContent = this.SelectContent;
this.UpdateCursor();
},
////
////// /////// ///
HideCursor: function()
{
editor.WordControl.m_oLogicDocument.DrawingDocument.TargetEnd();
},
ShowCursor: function()
{
//узнать зачем обе функции вызывать
editor.WordControl.m_oLogicDocument.DrawingDocument.TargetStart();
editor.WordControl.m_oLogicDocument.DrawingDocument.TargetShow();
},
//////// var Pos = this.SelectContent.CurPos,
EndPos = this.SelectContent.CurPos + 1;
DrawSelect2: function() History.Add(this.CurrentContent, {Type: historyitem_Math_AddItem, Items: items, Pos: Pos, PosEnd: EndPos});
{
this.SelectContent.drawSelect2();
},
Refresh_RecalcData2: function()
{
this.Parent.Refresh_RecalcData2();
}, },
//test CreateEquation: function(indef)
// из MathControl
IsRect: function(x, y)
{ {
var size = this.Root.size; History.Create_NewPoint();
return ( x > 0 && x < size.width && y > 0 && y < size.height);
var Pos = this.SelectContent.CurPos + 1;
var items = this.SelectContent.createEquation(indef);
this.CurrentContent = this.SelectContent;
var EndPos = this.SelectContent.CurPos + 1;
History.Add(this.CurrentContent, {Type: historyitem_Math_AddItem, Items: items, Pos: Pos, PosEnd: EndPos});
}, },
GetCoordComp: function(x, y) UpdateCursor: function()
{ {
var _x = x - this.pos.x; this.SelectContent.update_Cursor();
var _y = y - this.pos.y;
return {x: _x, y: _y};
}, },
CreateEquation: function(indef) Refresh_RecalcData2: function()
{ {
this.CreateEquation2(indef); this.Parent.Refresh_RecalcData2();
// временно
//this.RecalculateReverse();
//this.Root.Resize();
this.Resize(g_oTextMeasurer);
this.UpdatePosition();
}, },
RecalculateComposition: function(oMeasure, TextPr) // textPrp в тестовом режиме, просто отрисуем с ними формулу RecalculateComposition: function(oMeasure, TextPr) // textPrp в тестовом режиме, просто отрисуем с ними формулу
{ {
////* test *////
/*var textPrp = new TextPr();
this.DefaultTxtPrp.FontSize = 11;
textPrp.Marge(this.DefaultTxtPrp);
textPrp.Merge(TextPr);
this.DefaultTxtPrp = textPrp;*/
///////////////////////
this.Root.Resize(oMeasure); // пересчитываем всю формулу this.Root.Resize(oMeasure); // пересчитываем всю формулу
var width = this.Root.size.width, var width = this.Root.size.width,
...@@ -6807,37 +6732,12 @@ CMathComposition.prototype = ...@@ -6807,37 +6732,12 @@ CMathComposition.prototype =
return {Width: width, Height: height, WidthVisible: width }; return {Width: width, Height: height, WidthVisible: width };
}, },
SetReferenceComposition: function()
{
this.Root.setReferenceComposition(this);
},
//////// For edit ////////
test_for_edit: function()
{
var props =
{
type: BAR_FRACTION
};
var fract = new CFraction();
addToContent_ForRead(this.Root, fract, props);
fract.getNumerator().addTxt("a");
fract.getDenominator().addTxt("b");
},
test_for_edit_2: function()
{
simulatorMComposition(this, MATH_EDIT);
},
Selection_SetStart: function(X, Y, PageNum) Selection_SetStart: function(X, Y, PageNum)
{ {
var x = X - this.pos.x, var x = X - this.pos.x,
y = Y - this.pos.y; y = Y - this.pos.y;
this.Root.selection_Start(x, y); this.Root.selection_Start(x, y);
//this.SelectContent = result.SelectContent; // если SetEnd придет раньше
}, },
Selection_SetEnd: function(X, Y, PageNum, MouseEvent) Selection_SetEnd: function(X, Y, PageNum, MouseEvent)
{ {
...@@ -6849,7 +6749,7 @@ CMathComposition.prototype = ...@@ -6849,7 +6749,7 @@ CMathComposition.prototype =
}, },
Selection_Draw: function() Selection_Draw: function()
{ {
this.SelectContent.drawSelect2(); this.SelectContent.drawSelect();
}, },
Selection_Beginning: function(bStart) // если приходит bStart = false, то это означает Selection_SetEnd (конец селекта в начале контента) Selection_Beginning: function(bStart) // если приходит bStart = false, то это означает Selection_SetEnd (конец селекта в начале контента)
{ {
...@@ -6875,7 +6775,41 @@ CMathComposition.prototype = ...@@ -6875,7 +6775,41 @@ CMathComposition.prototype =
Is_Empty: function() Is_Empty: function()
{ {
return this.Root.IsEmpty(); return this.Root.IsEmpty();
},
///////// for Undo/Redo ////////
Get_SelectionState : function()
{
var State = new Object();
var stackCurrent = new Array();
this.CurrentContent.getStackPositions( stackCurrent );
State.Current =
{
stack: stackCurrent
};
var stackSelect = new Array();
this.SelectContent.getStackPositions( stackSelect );
State.Select =
{
StartSelect: this.SelectContent.RealSelect.startPos - 1,
EndSelect: this.SelectContent.RealSelect.endPos - 1,
stack: stackSelect
};
return State;
},
Set_SelectionState : function(State)
{
var stackSelect = Common_CopyObj(State.Select.stack),
stackCurrent = Common_CopyObj(State.Current.stack);
this.SelectContent = this.Root.getContent( stackSelect, false );
this.CurrentContent = this.Root.getContent( stackCurrent, true );
} }
/////////////////////////////////////////
} }
......
...@@ -184,7 +184,7 @@ CMathText.prototype = ...@@ -184,7 +184,7 @@ CMathText.prototype =
this.size = {width: _width, widthG: widthG, height: _height, center: _center, ascent: _ascent, descent: _descent}; this.size = {width: _width, widthG: widthG, height: _height, center: _center, ascent: _ascent, descent: _descent};
}, },
resize: function(oMeasure) Resize: function(oMeasure)
{ {
var letter = this.getCode(); var letter = this.getCode();
...@@ -341,10 +341,6 @@ CMathText.prototype = ...@@ -341,10 +341,6 @@ CMathText.prototype =
this.size.center = this.size.center*(this.transform.sy + this.transform.shy);*/ this.size.center = this.size.center*(this.transform.sy + this.transform.shy);*/
}, },
Resize: function(oMeasure)
{
this.resize(oMeasure);
},
IsJustDraw: function() IsJustDraw: function()
{ {
return this.bJDraw; return this.bJDraw;
......
...@@ -2533,14 +2533,14 @@ COperator.prototype.getProps = function(props, defaultProps) ...@@ -2533,14 +2533,14 @@ COperator.prototype.getProps = function(props, defaultProps)
this.defaultType = defaultProps.type; this.defaultType = defaultProps.type;
var bDelimiter = this.type == OPER_DELIMITER || this.type == OPER_SEPARATOR, var bDelimiter = this.type == OPER_DELIMITER || this.type == OPER_SEPARATOR,
bType = typeof(props.type)!=="undefined" && props.type !== null, bNotType = typeof(props.type)=="undefined" || props.type == null,
bEmptyStr = typeof(chr) === "string" && chr.length == 0, bEmptyStr = typeof(chr) === "string" && chr.length == 0,
bCode = typeof(chr) === "string" && chr.length > 0; bCode = typeof(chr) === "string" && chr.length > 0;
var code = bCode ? chr.charCodeAt(0) : null; var code = bCode ? chr.charCodeAt(0) : null;
var bDPrpDelim = bDelimiter && !bType && bEmptyStr, var bDPrpDelim = bDelimiter && bNotType && bEmptyStr,
bDPrpOther = !bDelimiter && !bType && !bCode; bDPrpOther = !bDelimiter && bNotType && !bCode;
if(bDPrpDelim || bDPrpOther) if(bDPrpDelim || bDPrpOther)
{ {
...@@ -2722,15 +2722,6 @@ CDelimiter.prototype.init = function(props) ...@@ -2722,15 +2722,6 @@ CDelimiter.prototype.init = function(props)
else if(props.grow == false || props.grow == 0) else if(props.grow == false || props.grow == 0)
this.grow = false; this.grow = false;
if(props.begChr == undefined)
props.begChrType = PARENTHESIS_LEFT;
if(props.endChr == undefined)
props.endChrType = PARENTHESIS_RIGHT;
if(props.endChr == undefined && props.column >1)
props.sepChrType = DELIMITER_LINE;
var begPrp = var begPrp =
{ {
chr: props.begChr, chr: props.begChr,
...@@ -3253,7 +3244,7 @@ CGroupCharacter.prototype.init = function(props) ...@@ -3253,7 +3244,7 @@ CGroupCharacter.prototype.init = function(props)
/*this.setOperator(new COperator(glyph));*/ /*this.setOperator(new COperator(glyph));*/
if(this.operator.IsArrow()) if(this.operator.IsArrow())
this.setReduct(DEGR_REDUCT); /// заменить впоследствии на более подходящую функцию this.setReduct(DEGR_REDUCT);
} }
CGroupCharacter.prototype.getCenter = function() CGroupCharacter.prototype.getCenter = function()
{ {
......
...@@ -18,7 +18,7 @@ function simulatorMComposition( MComposition, ttype) ...@@ -18,7 +18,7 @@ function simulatorMComposition( MComposition, ttype)
props = props =
{ {
type: BAR_FRACTION //type: BAR_FRACTION
}; };
var fract = new CFraction(); var fract = new CFraction();
addToContent_ForRead(accent.getBase(), fract, props); addToContent_ForRead(accent.getBase(), fract, props);
...@@ -52,10 +52,13 @@ function simulatorMComposition( MComposition, ttype) ...@@ -52,10 +52,13 @@ function simulatorMComposition( MComposition, ttype)
props = props =
{ {
begChrType: PARENTHESIS_LEFT, begChr: "",
endChr: "",
sepChr: "",
//begChrType: PARENTHESIS_LEFT,
//endChrType: PARENTHESIS_RIGHT, //endChrType: PARENTHESIS_RIGHT,
endChr: ")", //endChr: ")",
sepChrType: DELIMITER_LINE, //sepChrType: DELIMITER_LINE,
column: 2 column: 2
}; };
...@@ -230,7 +233,7 @@ function simulatorMComposition( MComposition, ttype) ...@@ -230,7 +233,7 @@ function simulatorMComposition( MComposition, ttype)
lastElem.addTxt("w"); lastElem.addTxt("w");
var oper = new CGroupCharacter(); /*var oper = new CGroupCharacter();
props = props =
{ {
chrType: DOUBLE_ARROW_LR, chrType: DOUBLE_ARROW_LR,
...@@ -239,7 +242,7 @@ function simulatorMComposition( MComposition, ttype) ...@@ -239,7 +242,7 @@ function simulatorMComposition( MComposition, ttype)
addToContent_ForRead(lastElem, oper, props); addToContent_ForRead(lastElem, oper, props);
oper.getBase().addTxt("a"); oper.getBase().addTxt("a");*/
lastElem.addTxt("y"); lastElem.addTxt("y");
......
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