back ArrayPoints to native graphics

This commit is contained in:
Sergey Luzyanin
2025-11-13 16:16:27 +03:00
parent 2f93e1aeed
commit 7e37ad8592

View File

@ -54,6 +54,7 @@ function CNativeGraphics(nativeEmbed)
this.dash_no_smart = null;
this.TextClipRect = null;
this.ArrayPoints = null;
this.MaxEpsLine = null;
this.m_oTextPr = null;
@ -138,12 +139,16 @@ CNativeGraphics.prototype._m = function(x, y)
x = isNaN(x) ? 0 : x;
y = isNaN(y) ? 0 : y;
this.Native["_m"](x, y);
if (false === this.GetIntegerGrid() && this.ArrayPoints != null)
this.ArrayPoints[this.ArrayPoints.length] = {x: x, y: y};
};
CNativeGraphics.prototype._l = function(x, y)
{
x = isNaN(x) ? 0 : x;
y = isNaN(y) ? 0 : y;
this.Native["_l"](x, y);
if (false === this.GetIntegerGrid() && this.ArrayPoints != null)
this.ArrayPoints[this.ArrayPoints.length] = {x: x, y: y};
};
CNativeGraphics.prototype._c = function(x1, y1, x2, y2, x3, y3)
{
@ -154,6 +159,12 @@ CNativeGraphics.prototype._c = function(x1, y1, x2, y2, x3, y3)
x3 = isNaN(x3) ? 0 : x3;
y3 = isNaN(y3) ? 0 : y3;
this.Native["_c"](x1, y1, x2, y2, x3, y3);
if (false === this.GetIntegerGrid() && this.ArrayPoints != null)
{
this.ArrayPoints[this.ArrayPoints.length] = {x: x1, y: y1};
this.ArrayPoints[this.ArrayPoints.length] = {x: x2, y: y2};
this.ArrayPoints[this.ArrayPoints.length] = {x: x3, y: y3};
}
};
CNativeGraphics.prototype._c2 = function(x1, y1, x2, y2)
{
@ -162,6 +173,11 @@ CNativeGraphics.prototype._c2 = function(x1, y1, x2, y2)
x2 = isNaN(x2) ? 0 : x2;
y2 = isNaN(y2) ? 0 : y2;
this.Native["_c2"](x1, y1, x2, y2);
if (false === this.GetIntegerGrid() && this.ArrayPoints != null)
{
this.ArrayPoints[this.ArrayPoints.length] = {x: x1, y: y1};
this.ArrayPoints[this.ArrayPoints.length] = {x: x2, y: y2};
}
};
CNativeGraphics.prototype.ds = function()
{
@ -373,19 +389,43 @@ CNativeGraphics.prototype.DrawSpellingLine = function(y0, x0, x1, w)
CNativeGraphics.prototype.drawHorLine = function(align, y, x, r, penW)
{
this.Native["drawHorLine"](align, y, x, r, penW);
if (false === this.GetIntegerGrid() && this.ArrayPoints != null)
{
this.ArrayPoints[this.ArrayPoints.length] = {x: x, y: y};
this.ArrayPoints[this.ArrayPoints.length] = {x: r, y: y};
}
};
CNativeGraphics.prototype.drawHorLine2 = function(align, y, x, r, penW)
{
this.Native["drawHorLine2"](align, y, x, r, penW);
if (false === this.GetIntegerGrid() && this.ArrayPoints != null)
{
var _y1 = y - penW / 2;
var _y2 = _y1 + 2 * penW;
this.ArrayPoints[this.ArrayPoints.length] = {x: x, y: _y1};
this.ArrayPoints[this.ArrayPoints.length] = {x: r, y: _y1};
this.ArrayPoints[this.ArrayPoints.length] = {x: x, y: _y2};
this.ArrayPoints[this.ArrayPoints.length] = {x: r, y: _y2};
}
};
CNativeGraphics.prototype.drawVerLine = function(align, x, y, b, penW)
{
this.Native["drawVerLine"](align, x, y, b, penW);
if (false === this.GetIntegerGrid() && this.ArrayPoints != null)
{
this.ArrayPoints[this.ArrayPoints.length] = {x: x, y: y};
this.ArrayPoints[this.ArrayPoints.length] = {x: x, y: b};
}
};
// мега крутые функции для таблиц
CNativeGraphics.prototype.drawHorLineExt = function(align, y, x, r, penW, leftMW, rightMW)
{
this.Native["drawHorLineExt"](align, y, x, r, penW, leftMW, rightMW);
if (false === this.GetIntegerGrid() && this.ArrayPoints != null)
{
this.ArrayPoints[this.ArrayPoints.length] = {x: x, y: y};
this.ArrayPoints[this.ArrayPoints.length] = {x: r, y: y};
}
};
CNativeGraphics.prototype.rect = function(x, y, w, h)
{