Commit 511a5a26 authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

1. Предварительный вариант отрисовки радикала: добавлен крайний случай,...

1. Предварительный вариант отрисовки радикала: добавлен крайний случай, поправлена галка ( для степени и внизу у основания)
2. Поправлен баг с отрисовкой овала для интегралов по замкнутому контуру, поверхностных интегралов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@54756 954022d7-b5bf-4e40-9824-e11837661b57
parent 8fcad0cd
......@@ -883,7 +883,7 @@ CMathBase.prototype =
{
return this.Parent.remove(order);
},
recalculateSize: function()
recalculateSize: function(oMeasure)
{
var _width = 0;
var _height = 0;
......@@ -905,7 +905,7 @@ CMathBase.prototype =
_width += this.dW*(this.nCol - 1);
var _ascent = this.getAscent(_height);
var _ascent = this.getAscent(_height, oMeasure);
this.size = {width: _width, height: _height, ascent: _ascent};
},
......
......@@ -939,7 +939,7 @@ CDegreeSubSup.prototype.recalculateSize = function(oMeasure)
this.gapBase = iterUp.height - lUp + minGap/2;
}
iters.recalculateSize();
iters.recalculateSize(oMeasure);
var width = iters.size.width + base.size.width + this.dW;
var height = iters.size.height;
......
......@@ -380,6 +380,7 @@ CMathMatrix.prototype.addRow = function()
//this.elements[this.nRow-1][j].setComposition(this.Composition);
}
// не будет работать, т.к. нужен для пересчета oMeasure
this.recalculateSize();
}
......
......@@ -531,7 +531,7 @@ CNaryOperator.prototype.recalculateSize = function()
}
CNaryOperator.prototype.Resize = function()
{
this.recalculateSize(); //бычный пересчет, oMeasure не нужен
this.recalculateSize(); //обычный пересчет, oMeasure не нужен
}
CNaryOperator.prototype.setComposition = function(Compos)
{
......@@ -2888,7 +2888,8 @@ CContourIntegral.prototype.draw = function(x, y, pGraphics)
HH = coord2.H;
//var textScale = this.getTxtPrp().FontSize/850;// 1000 pt
var textScale = this.getCtrPrp().FontSize/850;// 1000 pt
var FontSize = this.getCtrPrp().FontSize;
var textScale = FontSize/850;// 1000 pt
var alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
var shX = (WW - W)*alpha/2,
......@@ -2908,11 +2909,13 @@ CContourIntegral.prototype.draw = function(x, y, pGraphics)
YY[i] = this.pos.y + y + YY[i]*alpha;
}
var penCircle = 750*FontSize/32;
var intGrid = pGraphics.GetIntegerGrid();
pGraphics.SetIntegerGrid(false);
pGraphics.p_width(750);
//pGraphics.p_width(750);
pGraphics.p_width(penCircle);
pGraphics.b_color1(0,0,0, 255);
pGraphics.p_color(0,0,0, 255);
......@@ -3391,9 +3394,8 @@ CSurfaceIntegral.prototype.draw = function(x, y, pGraphics)
WW = 1.6*coord2.W,
HH = coord2.H;
//var textScale = this.getTxtPrp().FontSize/850; // 1000 pt
var textScale = this.getCtrPrp().FontSize/850; // 1000 pt
var FontSize = this.getCtrPrp().FontSize;
var textScale = FontSize/850; // 1000 pt
var alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
......@@ -3414,11 +3416,12 @@ CSurfaceIntegral.prototype.draw = function(x, y, pGraphics)
YY[i] = this.pos.y + y + YY[i]*alpha;
}
var penSurface = 750*FontSize/32;
var intGrid = pGraphics.GetIntegerGrid();
pGraphics.SetIntegerGrid(false);
pGraphics.p_width(750);
pGraphics.p_width(penSurface);
pGraphics.b_color1(0,0,0, 255);
pGraphics.p_color(0,0,0, 255);
......@@ -3967,8 +3970,8 @@ CVolumeIntegral.prototype.draw = function(x, y, pGraphics)
WW = 2.1*coord2.W,
HH = coord2.H;
var textScale = this.getCtrPrp().FontSize/850; // 1000 pt
var FontSize = this.getCtrPrp().FontSize;
var textScale = FontSize/850; // 1000 pt
var alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
......@@ -3988,11 +3991,12 @@ CVolumeIntegral.prototype.draw = function(x, y, pGraphics)
YY[i] = this.pos.y + y + YY[i]*alpha;
}
var penVolume = 750*FontSize/32;
var intGrid = pGraphics.GetIntegerGrid();
pGraphics.SetIntegerGrid(false);
pGraphics.p_width(750);
pGraphics.p_width(penVolume);
pGraphics.b_color1(0,0,0, 255);
pGraphics.p_color(0,0,0, 255);
......
......@@ -15,6 +15,125 @@ CSignRadical.prototype.draw = function(x, y, pGraphics)
y += penW/2; // смещаем, для отрисовки верхней линии радикала
var x1 = this.pos.x + x,
//x2 = x1 + 0.2*this.widthSlash;
x2 = x1 + 0.044*txtPrp.FontSize;
var y2 = this.pos.y + y + this.size.height - this.sizeTick.height,
y1 = y2 + 0.11*this.widthSlash;
var tX = 1.7*penW * 0.5 * 25.4/96,
tY = (-1)*tX * 11/25 *0.5; // 11/25 - тангенс угла наклона
var tg = 0.2/0.11;
var tX = tg*0.85*penW,
tY = 0.92*penW / tg;
var x3 = x2,
y3 = y2 - tY;
/*var minHeight = plH * 1.1304931640625,
maxHeight = plH * 7.029296875;
var maxWidth = plH * 0.81171875;
var k = 0.2*maxWidth/(maxHeight - minHeight),
b = maxWidth*0.3 - k*minHeight;*/
var plH = 9.877777777777776 * txtPrp.FontSize /36;
// widthSlash = plH * 0.81171875;
// 1.393 * widthSlash
/*var k = 0.00343247*this.widthSlash,
b = 0.3*this.widthSlash - 1.130493*plH*k;*/
/*var k = 0.00343247*this.widthSlash,
b = 0.3*this.widthSlash - 1.393*this.widthSlash*k;*/
/*if(this.size.height < plH*7.029296875)
x4 = x3 + k*this.size.height + b;
else
x4 = x1 + this.widthSlash;*/
var x4, y4,
x5, y5;
y4 = this.pos.y + y + this.size.height - penW;
var sin = 0.876,
cos = 0.474;
y5 = y4 + penW/2*cos;
if(this.size.height < plH*7.029296875)
{
x4 = x3 + (y4-y3)/tg;
}
else
{
x4 = x1 + this.widthSlash - penW/3*sin;
}
x5 = x4 + penW/2*sin;
var x6 = x1 + this.widthSlash,
x7 = this.pos.x + x + this.size.width;
var y6 = this.pos.y + y,
y7 = this.pos.y + y;
pGraphics.p_width(penW*0.8*1000);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics.ds();
pGraphics.p_width(1.7*penW*1000);
pGraphics._s();
pGraphics._m(x3, y3);
pGraphics._l(x4, y4);
pGraphics.ds();
pGraphics.p_width(penW*1000);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
pGraphics.p_width(penW*1000);
pGraphics._s();
pGraphics._m(x5, y5);
pGraphics._l(x6, y6);
pGraphics._l(x7, y7);
pGraphics.ds();
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x4 - penW*0.6*sin, y4 - penW/6);
pGraphics._l(x5 + penW/3*sin, y4 - penW/6);
pGraphics.ds();
}
CSignRadical.prototype.old_draw = function(x, y, pGraphics)
{
var txtPrp = this.Parent.getCtrPrp();
//var txtPrp = this.Parent.getTxtPrp();
var penW = txtPrp.FontSize*g_dKoef_pt_to_mm*0.042;
y += penW/2; // смещаем, для отрисовки верхней линии радикала
var plH = 9.877777777777776 * txtPrp.FontSize /36;
var x1 = this.pos.x + x,
......@@ -81,7 +200,7 @@ CSignRadical.prototype.draw = function(x, y, pGraphics)
pGraphics.ds();
}
CSignRadical.prototype.recalculateSize = function()
CSignRadical.prototype.old_recalculateSize = function()
{
//var txtPrp = this.Parent.getTxtPrp();
var txtPrp = this.Parent.getCtrPrp();
......@@ -124,16 +243,22 @@ CSignRadical.prototype.recalculateSize = function()
maxHgtRad = plH * 7.029296875;
var minHgtTick = plH*0.6,
maxHgtTick = plH * 1.50732422;
//maxHgtTick = plH * 1.50732422;
maxHgtTick = 0.9*plH;
var heightTick;
var heightTick, widthTick;
if ( heightArg > maxHgtRad )
{
heightTick = maxHgtTick;
widthTick = 0.1196002747872799*txtPrp.FontSize;
}
else
{
var alpha = (heightArg - minHgtRad)/maxHgtRad;
heightTick = minHgtTick*(1 + alpha);
widthTick = 0.1196002747872799*txtPrp.FontSize;
}
////// width //////
......@@ -143,8 +268,88 @@ CSignRadical.prototype.recalculateSize = function()
width = widthSlash + gap + widthArg;
//////
////// tick width /////
var widthTick = 0.1196002747872799*txtPrp.FontSize;
this.sizeTick =
{
width : widthTick,
height : heightTick
};
this.widthSlash = widthSlash;
this.size = {height: height, width: width};
}
CSignRadical.prototype.recalculateSize = function()
{
//var txtPrp = this.Parent.getTxtPrp();
var txtPrp = this.Parent.getCtrPrp();
var sizeArg = this.Parent.getBase().size;
var height, width;
var top = txtPrp.FontSize*g_dKoef_pt_to_mm*0.15,
heightArg = sizeArg.height + top,
widthArg = sizeArg.width;
///// height //////
var plH = 9.877777777777776 * txtPrp.FontSize /36;
var H0 = plH,
H1 = plH*1.50732421875,
H2 = plH*2.760986328125,
H3 = plH*4.217578125,
H4 = plH*5.52197265625,
H5 = plH*7.029296875;
if(heightArg < H0)
height = H1*0.75;
else if( heightArg < H1 )
height = H1;
else if( heightArg < H2 )
height = H2;
else if( heightArg < H3 )
height = H3;
else if( heightArg < H4 )
height = H4;
else if(heightArg < H5)
height = H5;
else
height = heightArg;
//////
///// height tick //////
var minHgtRad = plH * 1.130493164,
maxHgtRad = plH * 7.029296875;
var minHgtTick = plH*0.6,
maxHgtTick = 1.25*plH;
var heightTick, widthTick,
gap, widthSlash;
if ( heightArg > maxHgtRad )
{
heightTick = maxHgtTick;
widthTick = 0.1196002747872799*txtPrp.FontSize;
widthSlash = plH * 0.7;
gap = 0.12683105468750022* plH;
}
else
{
var alpha = (heightArg - minHgtRad)/maxHgtRad;
heightTick = minHgtTick*(1 + alpha);
widthSlash = plH * 0.81171875;
gap = 0.12683105468750022* plH;
widthTick = 0.1196002747872799*txtPrp.FontSize;
}
////// width //////
//var widthSlash = plH * 0.9385498046875003;
width = widthSlash + gap + widthArg;
//////
this.sizeTick =
......
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