Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
ac712e36
Commit
ac712e36
authored
Apr 25, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete TEST_MATH
parent
fdc50868
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
2368 deletions
+0
-2368
word/Math/TEST_MATH/TEST_BUG_2.js
word/Math/TEST_MATH/TEST_BUG_2.js
+0
-122
word/Math/TEST_MATH/Test_Functions.js
word/Math/TEST_MATH/Test_Functions.js
+0
-371
word/Math/TEST_MATH/drawingBracket.js
word/Math/TEST_MATH/drawingBracket.js
+0
-1460
word/Math/TEST_MATH/drawingUnion.js
word/Math/TEST_MATH/drawingUnion.js
+0
-230
word/Math/TEST_MATH/print.js
word/Math/TEST_MATH/print.js
+0
-185
No files found.
word/Math/TEST_MATH/TEST_BUG_2.js
deleted
100644 → 0
View file @
fdc50868
function
CMathPosition
()
{
this
.
x
=
0
;
this
.
y
=
0
;
}
function
C_CAccent2
(
val
)
{
this
.
typeTest
=
val
;
this
.
Content
=
new
Array
();
this
.
Run
=
null
;
this
.
Test_ParaRun
=
null
;
this
.
TestRun
=
new
Array
();
this
.
A
=
null
;
this
.
X
=
null
;
this
.
operator
=
new
CTestMathText
(
true
);
this
.
init
();
}
C_CAccent2
.
prototype
.
init
=
function
()
{
var
A
=
new
CTestMathText
(
false
);
//A.addTxt("a");
var
X
=
new
CTestMathText
(
false
);
//X.addTxt("x");
this
.
A
=
A
;
this
.
X
=
X
;
this
.
TestRun
=
new
CTestRun
();
this
.
TestRun
.
Content
.
push
(
this
.
A
);
this
.
TestRun
.
Content
.
push
(
this
.
X
);
}
C_CAccent2
.
prototype
.
setPosition
=
function
(
pos
)
{
var
PosOper
=
new
CMathPosition
();
PosOper
.
x
=
pos
.
x
;
PosOper
.
y
=
pos
.
y
;
this
.
operator
.
setPosition
(
PosOper
);
var
PosBase
=
new
CMathPosition
();
PosBase
.
x
=
pos
.
x
;
PosBase
.
y
=
pos
.
y
;
this
.
TestRun
.
setPosition
(
PosBase
);
}
C_CAccent2
.
prototype
.
Resize
=
function
()
{
this
.
A
.
size
=
{
height
:
0
,
width
:
2.234
};
this
.
X
.
size
=
{
height
:
0
,
width
:
2.234
};
}
C_CAccent2
.
prototype
.
getPosition
=
function
()
{
return
this
.
TestRun
.
getPosition
();
}
function
CTestRun
()
{
this
.
Content
=
new
Array
();
}
CTestRun
.
prototype
.
setPosition
=
function
(
pos
)
{
var
NewPos
=
new
CMathPosition
();
NewPos
.
x
=
pos
.
x
;
NewPos
.
y
=
pos
.
y
;
for
(
var
i
=
0
;
i
<
this
.
Content
.
length
;
i
++
)
{
this
.
Content
[
i
].
setPosition
(
NewPos
);
NewPos
.
x
+=
this
.
Content
[
i
].
size
.
width
;
}
}
CTestRun
.
prototype
.
getPosition
=
function
()
{
return
"
Type 4, First position
"
+
this
.
Content
[
0
].
pos
.
x
+
"
second position
"
+
this
.
Content
[
1
].
pos
.
x
;
}
function
CTestMathText
(
bJDraw
)
{
this
.
pos
=
new
CMathPosition
();
this
.
bJDraw
=
bJDraw
;
this
.
GapLeft
=
0
;
this
.
rasterOffsetX
=
0
;
this
.
rasterOffsetY
=
0
;
}
CTestMathText
.
prototype
.
setPosition
=
function
(
pos
)
{
if
(
!
this
.
bJDraw
)
// for text
{
this
.
pos
.
x
=
pos
.
x
+
this
.
GapLeft
;
this
.
pos
.
y
=
pos
.
y
;
}
else
// for symbol only drawing
{
this
.
pos
.
x
=
pos
.
x
-
this
.
rasterOffsetX
;
this
.
pos
.
y
=
pos
.
y
-
this
.
rasterOffsetY
;
}
}
word/Math/TEST_MATH/Test_Functions.js
deleted
100644 → 0
View file @
fdc50868
This diff is collapsed.
Click to expand it.
word/Math/TEST_MATH/drawingBracket.js
deleted
100644 → 0
View file @
fdc50868
This diff is collapsed.
Click to expand it.
word/Math/TEST_MATH/drawingUnion.js
deleted
100644 → 0
View file @
fdc50868
"
use strict
"
;
var
CF_X1
=
0.29
;
var
CF_X2
=
0.34
;
var
CF_X3
=
0.07
;
var
CF_X4
=
0.36
;
var
CF_X5
=
0
;
var
CF_X6
=
0.36
;
var
CF_Y1
=
0.78
;
var
CF_Y2
=
0.79
;
/*var CF_Y3 = 0.84;
var CF_Y4 = 1.0;
var CF_Y5 = 0.77;
var CF_Y6 = 0.85;*/
var
CF_Y3
=
0.75
;
var
CF_Y4
=
1.0
;
var
CF_Y5
=
0.75
;
var
CF_Y6
=
0.84
;
//var COEFF_TH = 0.73;
var
COEFF_TH
=
0.81
;
var
CF_WIDTH
=
1.3
;
var
CF_HEIGHT
=
1
;
var
U_SIZE
=
36
/
0.76
;
function
DrawUnion
()
{
/*var augm = + document.getElementById("CoeffUnion").value;
augm = augm/100;*/
var
x
=
23
,
y
=
27
;
var
betta
=
U_SIZE
/
36
;
//var _width = 1.3*9.6159*betta,
var
_width
=
CF_WIDTH
*
9.6159
*
betta
,
//var _width = 10.312548828125*betta,
_height
=
11.994444444444444
*
betta
;
var
gap
=
0.93
*
betta
;
var
X
=
[],
Y
=
[];
/*X[0] = 10125; Y[0] = 56563;
X[1] = 10125; Y[1] = 0;
X[2] = 0; Y[2] = 0;
X[3] = 0; Y[3] = 56313;
X[4] = 0; Y[4] = 76750;
X[5] = 9031; Y[5] = 87032;
X[6] = 18063; Y[6] = 97313;
X[7] = 35438; Y[7] = 97313;
X[8] = 52813; Y[8] = 97313;
X[9] = 61875; Y[9] = 87251;
X[10] = 70938; Y[10] = 77188;
X[11] = 70938; Y[11] = 58938;
X[12] = 70938; Y[12] = 0;
X[13] = 60813; Y[13] = 0;
X[14] = 60813; Y[14] = 56563;
X[15] = 60813; Y[15] = 72938;
X[16] = 54375; Y[16] = 80782;
X[17] = 47938; Y[17] = 88625;
X[18] = 35438; Y[18] = 88625;
X[19] = 22938; Y[19] = 88625;
X[20] = 16531; Y[20] = 80782;
X[21] = 10125; Y[21] = 72938;
X[22] = 10125; Y[22] = 56563;*/
X
[
0
]
=
35438
;
Y
[
0
]
=
88625
;
X
[
1
]
=
22938
;
Y
[
1
]
=
88625
;
X
[
2
]
=
16531
;
Y
[
2
]
=
80782
;
X
[
3
]
=
10125
;
Y
[
3
]
=
72938
;
X
[
4
]
=
10125
;
Y
[
4
]
=
56563
;
X
[
5
]
=
10125
;
Y
[
5
]
=
0
;
X
[
6
]
=
0
;
Y
[
6
]
=
0
;
X
[
7
]
=
0
;
Y
[
7
]
=
56313
;
X
[
8
]
=
0
;
Y
[
8
]
=
76750
;
X
[
9
]
=
9031
;
Y
[
9
]
=
87032
;
X
[
10
]
=
18063
;
Y
[
10
]
=
97313
;
X
[
11
]
=
35438
;
Y
[
11
]
=
97313
;
var
textScale
=
U_SIZE
/
1000
,
// 1000 pt
alpha
=
textScale
*
25.4
/
96
/
64
;
//var thick = X[1] - X[2];
var
thick
=
(
X
[
5
]
-
X
[
6
])
*
COEFF_TH
;
var
Width_1
=
(
_width
-
gap
)
/
alpha
-
2
*
thick
,
Height
=
_height
/
alpha
;
var
w1
=
X
[
2
]
-
X
[
4
],
w2
=
X
[
0
]
-
X
[
2
],
w3
=
X
[
3
]
-
X
[
4
],
w4
=
X
[
1
]
-
X
[
2
];
/*var k1 = w3/w1,
k2 = w4/w2;*/
var
k1
=
CF_X3
,
k2
=
CF_X4
;
var
WW1
=
CF_X1
*
Width_1
/
2
,
WW2
=
WW1
*
k1
,
WW3
=
(
1
-
CF_X1
)
*
Width_1
/
2
*
k2
;
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F_Y5
;
Y
[
10
]
=
Y
[
7
]
+
HH2
*
CF_Y2
+
h4
*
CF_Y6
;
Y
[
11
]
=
Y
[
7
]
+
HH2
;
var
HH
=
Y
[
4
]
*
0.68
;
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
Y
[
i
]
+=
HH
;
Y
[
7
+
i
]
+=
HH
;
}
for
(
var
i
=
0
;
i
<
11
;
i
++
)
{
X
[
22
-
i
]
=
Width
-
X
[
i
];
Y
[
22
-
i
]
=
Y
[
i
];
}
var
XX
=
[],
YY
=
[];
for
(
var
i
=
0
;
i
<
23
;
i
++
)
{
var
xxx
=
X
[
i
]
+
7100
;
var
str
=
"
X[
"
+
i
+
"
] =
"
+
xxx
+
"
; Y[
"
+
i
+
"
] =
"
+
Y
[
i
]
+
"
;
"
;
console
.
log
(
str
);
}
for
(
var
i
=
0
;
i
<
23
;
i
++
)
{
XX
[
i
]
=
x
+
X
[
i
]
*
alpha
;
YY
[
i
]
=
y
+
Y
[
i
]
*
alpha
;
}
var
intGrid
=
MathControl
.
pGraph
.
GetIntegerGrid
();
MathControl
.
pGraph
.
SetIntegerGrid
(
false
);
MathControl
.
pGraph
.
p_width
(
1000
);
MathControl
.
pGraph
.
b_color1
(
0
,
0
,
0
,
255
);
MathControl
.
pGraph
.
p_color
(
0
,
0
,
0
,
255
);
MathControl
.
pGraph
.
_s
();
MathControl
.
pGraph
.
_m
(
XX
[
0
],
YY
[
0
]);
MathControl
.
pGraph
.
_c
(
XX
[
0
],
YY
[
0
],
XX
[
1
],
YY
[
1
],
XX
[
2
],
YY
[
2
]);
MathControl
.
pGraph
.
_c
(
XX
[
2
],
YY
[
2
],
XX
[
3
],
YY
[
3
],
XX
[
4
],
YY
[
4
]);
MathControl
.
pGraph
.
_l
(
XX
[
5
],
YY
[
5
]);
MathControl
.
pGraph
.
_l
(
XX
[
6
],
YY
[
6
]);
MathControl
.
pGraph
.
_l
(
XX
[
7
],
YY
[
7
]);
MathControl
.
pGraph
.
_c
(
XX
[
7
],
YY
[
7
],
XX
[
8
],
YY
[
8
],
XX
[
9
],
YY
[
9
]);
MathControl
.
pGraph
.
_c
(
XX
[
9
],
YY
[
9
],
XX
[
10
],
YY
[
10
],
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
.
_l
(
XX
[
16
],
YY
[
16
]);
MathControl
.
pGraph
.
_l
(
XX
[
17
],
YY
[
17
]);
MathControl
.
pGraph
.
_l
(
XX
[
18
],
YY
[
18
]);
MathControl
.
pGraph
.
_c
(
XX
[
18
],
YY
[
18
],
XX
[
19
],
YY
[
19
],
XX
[
20
],
YY
[
20
]);
MathControl
.
pGraph
.
_c
(
XX
[
20
],
YY
[
20
],
XX
[
21
],
YY
[
21
],
XX
[
22
],
YY
[
22
]);
MathControl
.
pGraph
.
df
();
MathControl
.
pGraph
.
SetIntegerGrid
(
intGrid
);
}
word/Math/TEST_MATH/print.js
deleted
100644 → 0
View file @
fdc50868
"
use strict
"
;
var
DEGR_REDUCT
=
0.728
;
var
default_font
=
{
FontFamily
:
{
Name
:
"
Cambria Math
"
,
Index
:
-
1
},
FontSize
:
36
};
//var metricsDF = {};
function
GetMathFont
(
GFont
)
{
g_oTextMeasurer
.
SetFont
(
GFont
);
var
metrics
=
{
Height
:
g_oTextMeasurer
.
GetHeight
(),
Descender
:
(
-
1
)
*
g_oTextMeasurer
.
GetDescender
(),
Placeholder
:
g_oTextMeasurer
.
Measure2Code
(
StartTextElement
)
};
var
Fnt
=
{
FontSize
:
GFont
.
FontSize
,
FontFamily
:
{
Name
:
GFont
.
FontFamily
.
Name
,
Index
:
GFont
.
FontFamily
.
Index
},
metrics
:
metrics
};
return
Fnt
;
}
/*function GetMetrics(value, font)
{
g_oTextMeasurer.SetFont(type.font);
return g_oTextMeasurer.Measure2Code(value);
}*/
/*function getTypeHeight(h)
{
var H1 = metricsDF.Height + metricsDF.Descender + metricsDF.Placeholder.Height,
H2 = 2.5*metricsDF.Placeholder.Height,
H3 = H1 + metricsDF.Placeholder.Height,
H4 = H3 + metricsDF.Descender,
H5 = H3 + H1;
var type = null;
if(h < H2)
type = 0;
else if(h < H4)
type = 1;
else if(h < H5)
type = 2;
else
type = 3;
return type;
}*/
function
getStateHeight
(
height
,
print
)
{
var
metric
=
print
.
metrics
;
var
state
=
null
;
var
H1
=
metric
.
Height
+
metric
.
Descender
+
metric
.
Placeholder
.
Height
,
H2
=
2.5
*
metric
.
Placeholder
.
Height
,
H3
=
H1
+
metric
.
Placeholder
.
Height
,
H4
=
H3
+
metric
.
Descender
,
H5
=
H3
+
H1
;
if
(
height
<
H2
)
state
=
0
;
else
if
(
height
<
H4
)
state
=
1
;
else
if
(
height
<
H5
)
state
=
2
;
else
state
=
3
;
return
state
;
}
function
getMaxHeight
(
print
)
{
var
metric
=
print
.
metrics
;
var
H1
=
metric
.
Height
+
metric
.
Descender
+
metric
.
Placeholder
.
Height
,
H2
=
2.5
*
metric
.
Placeholder
.
Height
,
H3
=
H1
+
metric
.
Placeholder
.
Height
,
H4
=
H3
+
metric
.
Descender
,
H5
=
H3
+
H1
;
return
H5
;
}
function
getStateHeight_2
(
height
,
GFont
)
{
var
metric
=
GFont
.
metrics
;
var
state
=
null
;
var
gap
=
metric
.
Height
-
metric
.
Placeholder
.
Height
;
var
H1
=
metric
.
Height
,
H2
=
H1
+
gap
,
H3
=
2
*
metric
.
Placeholder
.
Height
+
gap
,
H4
=
3
*
metric
.
Placeholder
.
Height
+
2
*
gap
,
H5
=
4
*
metric
.
Placeholder
.
Height
+
2
*
gap
;
if
(
height
<
H1
)
state
=
0
;
else
if
(
height
<
H3
)
state
=
1
;
else
if
(
height
<
H4
)
state
=
2
;
else
if
(
height
<
H5
)
state
=
3
;
else
state
=
4
;
return
state
;
}
function
getTypeDegree
(
IFont
,
flag
)
{
var
fontSize
=
null
;
var
CONST_INDEX
=
flag
?
0.62
:
0.728
;
var
sD
=
IFont
.
FontSize
*
CONST_INDEX
;
if
(
sD
-
Math
.
floor
(
sD
)
>
0.65
)
fontSize
=
Math
.
ceil
(
sD
)
-
0.5
;
else
fontSize
=
Math
.
floor
(
sD
);
var
GFont
=
{
FontFamily
:
IFont
.
FontFamily
,
FontSize
:
fontSize
};
var
IFont
=
GetMathFont
(
GFont
);
return
IFont
;
}
function
getStateHeight_1
(
height
,
GFont
)
{
var
metric
=
GFont
.
metrics
,
state
=
0
;
var
gap
=
metric
.
Height
-
metric
.
Placeholder
.
Height
;
var
H5
=
5
*
metric
.
Placeholder
.
Height
+
4
*
gap
;
if
(
H5
<
height
)
state
=
3
;
return
state
;
}
function
getMaxHeight_1
(
print
)
{
var
metric
=
print
.
metrics
;
var
gap
=
metric
.
Height
-
metric
.
Placeholder
.
Height
;
return
5
*
metric
.
Placeholder
.
Height
+
4
*
gap
;
}
function
getStateHeight_3
(
height
,
GFont
)
//for radical
{
var
metric
=
GFont
.
metrics
,
GenHeight
;
var
gap
=
metric
.
Height
-
metric
.
Placeholder
.
Height
;
var
H0
=
metric
.
Placeholder
.
Height
,
H1
=
metric
.
Height
,
H2
=
2
*
metric
.
Placeholder
.
Height
+
1.5
*
gap
,
H3
=
3
*
metric
.
Placeholder
.
Height
+
2.4
*
gap
,
H4
=
4
*
metric
.
Placeholder
.
Height
+
3
*
gap
,
H5
=
5
*
metric
.
Placeholder
.
Height
+
4
*
gap
;
if
(
height
<
H0
)
GenHeight
=
H1
*
0.75
;
else
if
(
height
<
H1
)
GenHeight
=
H1
;
else
if
(
height
<
H2
)
GenHeight
=
H2
;
else
if
(
height
<
H3
)
GenHeight
=
H3
;
else
if
(
height
<
H4
)
GenHeight
=
H4
;
else
if
(
height
<
H5
)
GenHeight
=
H5
;
else
GenHeight
=
height
;
return
GenHeight
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment