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
eb20b49e
Commit
eb20b49e
authored
Apr 06, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
линейки с дюймами
parent
316cc020
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
397 additions
and
188 deletions
+397
-188
common/commonDefines.js
common/commonDefines.js
+6
-1
slide/api.js
slide/api.js
+8
-0
word/Drawing/Rulers.js
word/Drawing/Rulers.js
+374
-187
word/api.js
word/api.js
+9
-0
No files found.
common/commonDefines.js
View file @
eb20b49e
...
...
@@ -815,4 +815,9 @@ var changestype_2_AdditionalTypes = 6; // Дополнительные п
var
contentchanges_Add
=
1
;
var
contentchanges_Remove
=
2
;
var
offlineMode
=
'
_offline_
'
;
\ No newline at end of file
var
offlineMode
=
'
_offline_
'
;
var
c_oAscRulerUnits
=
{
Millimeter
:
0
,
Inch
:
1
};
\ No newline at end of file
slide/api.js
View file @
eb20b49e
...
...
@@ -3812,6 +3812,14 @@ asc_docs_api.prototype.asc_GetViewRulers = function()
{
return
this
.
WordControl
.
m_bIsRuler
;
};
asc_docs_api
.
prototype
.
asc_SetDocumentUnits
=
function
(
_units
)
{
if
(
this
.
WordControl
&&
this
.
WordControl
.
m_oHorRuler
&&
this
.
WordControl
.
m_oVerRuler
)
{
this
.
WordControl
.
m_oHorRuler
.
Units
=
_units
;
this
.
WordControl
.
m_oVerRuler
.
Units
=
_units
;
}
};
asc_docs_api
.
prototype
.
SetMobileVersion
=
function
(
val
)
{
...
...
word/Drawing/Rulers.js
View file @
eb20b49e
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
* In accordance with Section 7(a) of the GNU GPL its Section 15 shall be amended to the effect that
* Ascensio System SIA expressly excludes the warranty of non-infringement of any third-party rights.
*
* THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. For more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
*
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
*
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
*
* Pursuant to Section 7 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
* relevant author attributions when distributing the software. If the display of the logo in its graphic
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
* in every copy of the program you distribute.
* Pursuant to Section 7 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"
use strict
"
;
function
CTab
(
pos
,
type
)
...
...
@@ -209,6 +209,8 @@ function CHorRuler()
this
.
SimpleChanges
=
new
RulerCheckSimpleChanges
();
this
.
Units
=
c_oAscRulerUnits
.
Inch
;
this
.
InitTablePict
=
function
()
{
var
_data
=
g_memory
.
ctx
.
createImageData
(
7
,
8
);
...
...
@@ -600,8 +602,7 @@ function CHorRuler()
context
.
fillStyle
=
"
#585B5E
"
;
var
mm_1_4
=
10
*
dKoef_mm_to_pix
/
4
;
var
lCount1
=
((
width
-
left_margin
)
/
mm_1_4
)
>>
0
;
var
lCount2
=
(
left_margin
/
mm_1_4
)
>>
0
;
var
inch_1_8
=
25.4
*
dKoef_mm_to_pix
/
8
;
var
middleVert
=
(
this
.
m_nTop
+
this
.
m_nBottom
)
/
2
;
var
part1
=
1
;
...
...
@@ -609,93 +610,178 @@ function CHorRuler()
context
.
font
=
"
7pt Arial
"
;
var
index
=
0
;
var
num
=
0
;
for
(
var
i
=
1
;
i
<
lCount1
;
i
++
)
if
(
this
.
Units
==
c_oAscRulerUnits
.
Millimeter
)
{
var
lXPos
=
((
left_margin
+
i
*
mm_1_4
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
4
)
index
=
0
;
var
lCount1
=
((
width
-
left_margin
)
/
mm_1_4
)
>>
0
;
var
lCount2
=
(
left_margin
/
mm_1_4
)
>>
0
;
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
lXPos
-=
(
lWidthText
/
2.0
);
context
.
fillText
(
strNum
,
lXPos
,
this
.
m_nBottom
-
3
);
}
else
if
(
1
==
index
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
}
else
if
(
2
==
index
)
var
index
=
0
;
var
num
=
0
;
for
(
var
i
=
1
;
i
<
lCount1
;
i
++
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part2
);
context
.
lineTo
(
lXPos
,
middleVert
+
part2
);
context
.
stroke
();
var
lXPos
=
((
left_margin
+
i
*
mm_1_4
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
4
)
index
=
0
;
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
lXPos
-=
(
lWidthText
/
2.0
);
context
.
fillText
(
strNum
,
lXPos
,
this
.
m_nBottom
-
3
);
}
else
if
(
1
==
index
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
}
else
if
(
2
==
index
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part2
);
context
.
lineTo
(
lXPos
,
middleVert
+
part2
);
context
.
stroke
();
}
else
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
}
}
else
index
=
0
;
num
=
0
;
for
(
var
i
=
1
;
i
<=
lCount2
;
i
++
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
var
lXPos
=
((
left_margin
-
i
*
mm_1_4
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
4
)
index
=
0
;
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
lXPos
-=
(
lWidthText
/
2.0
);
context
.
fillText
(
strNum
,
lXPos
,
this
.
m_nBottom
-
3
);
}
else
if
(
1
==
index
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
}
else
if
(
2
==
index
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part2
);
context
.
lineTo
(
lXPos
,
middleVert
+
part2
);
context
.
stroke
();
}
else
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
}
}
}
index
=
0
;
num
=
0
;
for
(
var
i
=
1
;
i
<=
lCount2
;
i
++
)
else
if
(
this
.
Units
==
c_oAscRulerUnits
.
Inch
)
{
var
lXPos
=
((
left_margin
-
i
*
mm_1_4
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
4
)
index
=
0
;
var
lCount1
=
((
width
-
left_margin
)
/
inch_1_8
)
>>
0
;
var
lCount2
=
(
left_margin
/
inch_1_8
)
>>
0
;
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
lXPos
-=
(
lWidthText
/
2.0
);
context
.
fillText
(
strNum
,
lXPos
,
this
.
m_nBottom
-
3
);
}
else
if
(
1
==
index
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
}
else
if
(
2
==
index
)
var
index
=
0
;
var
num
=
0
;
for
(
var
i
=
1
;
i
<
lCount1
;
i
++
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part2
);
context
.
lineTo
(
lXPos
,
middleVert
+
part2
);
context
.
stroke
();
var
lXPos
=
((
left_margin
+
i
*
inch_1_8
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
8
)
index
=
0
;
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
lXPos
-=
(
lWidthText
/
2.0
);
context
.
fillText
(
strNum
,
lXPos
,
this
.
m_nBottom
-
3
);
}
else
if
(
4
==
index
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part2
);
context
.
lineTo
(
lXPos
,
middleVert
+
part2
);
context
.
stroke
();
}
else
if
(
inch_1_8
>
8
)
{
// 1/8
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
}
}
else
index
=
0
;
num
=
0
;
for
(
var
i
=
1
;
i
<=
lCount2
;
i
++
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
var
lXPos
=
((
left_margin
-
i
*
inch_1_8
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
8
)
index
=
0
;
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
lXPos
-=
(
lWidthText
/
2.0
);
context
.
fillText
(
strNum
,
lXPos
,
this
.
m_nBottom
-
3
);
}
else
if
(
4
==
index
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part2
);
context
.
lineTo
(
lXPos
,
middleVert
+
part2
);
context
.
stroke
();
}
else
if
(
inch_1_8
>
8
)
{
// 1/8
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
}
}
}
...
...
@@ -2504,6 +2590,8 @@ function CVerRuler()
this
.
SimpleChanges
=
new
RulerCheckSimpleChanges
();
this
.
Units
=
c_oAscRulerUnits
.
Inch
;
this
.
CheckCanvas
=
function
()
{
this
.
m_dZoom
=
this
.
m_oWordControl
.
m_nZoomValue
/
100
;
...
...
@@ -2715,8 +2803,7 @@ function CVerRuler()
context
.
fillStyle
=
"
#585B5E
"
;
var
mm_1_4
=
10
*
dKoef_mm_to_pix
/
4
;
var
lCount1
=
((
height
-
top_margin
)
/
mm_1_4
)
>>
0
;
var
lCount2
=
(
top_margin
/
mm_1_4
)
>>
0
;
var
inch_1_8
=
25.4
*
dKoef_mm_to_pix
/
8
;
var
middleHor
=
(
this
.
m_nLeft
+
this
.
m_nRight
)
/
2
;
var
part1
=
1
;
...
...
@@ -2724,108 +2811,208 @@ function CVerRuler()
context
.
font
=
"
7pt Arial
"
;
var
index
=
0
;
var
num
=
0
;
for
(
var
i
=
1
;
i
<
lCount1
;
i
++
)
if
(
this
.
Units
==
c_oAscRulerUnits
.
Millimeter
)
{
var
lYPos
=
((
top_margin
+
i
*
mm_1_4
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
4
)
index
=
0
;
var
lCount1
=
((
height
-
top_margin
)
/
mm_1_4
)
>>
0
;
var
lCount2
=
(
top_margin
/
mm_1_4
)
>>
0
;
if
(
0
==
index
)
var
index
=
0
;
var
num
=
0
;
for
(
var
i
=
1
;
i
<
lCount1
;
i
++
)
{
num
++
;
// number
var
lYPos
=
((
top_margin
+
i
*
mm_1_4
)
>>
0
)
+
0.5
;
index
++
;
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
if
(
index
==
4
)
index
=
0
;
context
.
translate
(
middleHor
,
lYPos
);
context
.
rotate
(
-
Math
.
PI
/
2
);
context
.
fillText
(
strNum
,
-
lWidthText
/
2.0
,
4
);
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
context
.
translate
(
middleHor
,
lYPos
);
context
.
rotate
(
-
Math
.
PI
/
2
);
context
.
fillText
(
strNum
,
-
lWidthText
/
2.0
,
4
);
if
(
!
this
.
IsRetina
)
context
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
5
);
if
(
!
this
.
IsRetina
)
context
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
5
);
else
context
.
setTransform
(
2
,
0
,
0
,
2
,
0
,
10
);
}
else
if
(
1
==
index
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
}
else
if
(
2
==
index
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part2
,
lYPos
);
context
.
lineTo
(
middleHor
+
part2
,
lYPos
);
context
.
stroke
();
}
else
context
.
setTransform
(
2
,
0
,
0
,
2
,
0
,
10
);
}
else
if
(
1
==
index
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
}
else
if
(
2
==
index
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part2
,
lYPos
);
context
.
lineTo
(
middleHor
+
part2
,
lYPos
);
context
.
stroke
();
}
else
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
}
}
}
index
=
0
;
num
=
0
;
for
(
var
i
=
1
;
i
<=
lCount2
;
i
++
)
{
var
lYPos
=
((
top_margin
-
i
*
mm_1_4
)
>>
0
)
+
0.5
;
index
++
;
index
=
0
;
num
=
0
;
for
(
var
i
=
1
;
i
<=
lCount2
;
i
++
)
{
var
lYPos
=
((
top_margin
-
i
*
mm_1_4
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
4
)
index
=
0
;
if
(
index
==
4
)
index
=
0
;
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
context
.
translate
(
middleHor
,
lYPos
);
context
.
rotate
(
-
Math
.
PI
/
2
);
context
.
fillText
(
strNum
,
-
lWidthText
/
2.0
,
4
);
context
.
translate
(
middleHor
,
lYPos
);
context
.
rotate
(
-
Math
.
PI
/
2
);
context
.
fillText
(
strNum
,
-
lWidthText
/
2.0
,
4
);
if
(
!
this
.
IsRetina
)
context
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
5
);
if
(
!
this
.
IsRetina
)
context
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
5
);
else
context
.
setTransform
(
2
,
0
,
0
,
2
,
0
,
10
);
}
else
if
(
1
==
index
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
}
else
if
(
2
==
index
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part2
,
lYPos
);
context
.
lineTo
(
middleHor
+
part2
,
lYPos
);
context
.
stroke
();
}
else
context
.
setTransform
(
2
,
0
,
0
,
2
,
0
,
10
);
}
else
if
(
1
==
index
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
}
}
else
if
(
2
==
index
)
}
else
if
(
this
.
Units
==
c_oAscRulerUnits
.
Inch
)
{
var
lCount1
=
((
height
-
top_margin
)
/
inch_1_8
)
>>
0
;
var
lCount2
=
(
top_margin
/
inch_1_8
)
>>
0
;
var
index
=
0
;
var
num
=
0
;
for
(
var
i
=
1
;
i
<
lCount1
;
i
++
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part2
,
lYPos
);
context
.
lineTo
(
middleHor
+
part2
,
lYPos
);
context
.
stroke
();
var
lYPos
=
((
top_margin
+
i
*
inch_1_8
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
8
)
index
=
0
;
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
context
.
translate
(
middleHor
,
lYPos
);
context
.
rotate
(
-
Math
.
PI
/
2
);
context
.
fillText
(
strNum
,
-
lWidthText
/
2.0
,
4
);
if
(
!
this
.
IsRetina
)
context
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
5
);
else
context
.
setTransform
(
2
,
0
,
0
,
2
,
0
,
10
);
}
else
if
(
4
==
index
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part2
,
lYPos
);
context
.
lineTo
(
middleHor
+
part2
,
lYPos
);
context
.
stroke
();
}
else
if
(
inch_1_8
>
8
)
{
// 1/8
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
}
}
else
index
=
0
;
num
=
0
;
for
(
var
i
=
1
;
i
<=
lCount2
;
i
++
)
{
// 1/4
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
var
lYPos
=
((
top_margin
-
i
*
inch_1_8
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
8
)
index
=
0
;
if
(
0
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
num
;
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
context
.
translate
(
middleHor
,
lYPos
);
context
.
rotate
(
-
Math
.
PI
/
2
);
context
.
fillText
(
strNum
,
-
lWidthText
/
2.0
,
4
);
if
(
!
this
.
IsRetina
)
context
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
5
);
else
context
.
setTransform
(
2
,
0
,
0
,
2
,
0
,
10
);
}
else
if
(
4
==
index
)
{
// 1/2
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part2
,
lYPos
);
context
.
lineTo
(
middleHor
+
part2
,
lYPos
);
context
.
stroke
();
}
else
if
(
inch_1_8
>
8
)
{
// 1/8
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
}
}
}
...
...
word/api.js
View file @
eb20b49e
...
...
@@ -6351,6 +6351,15 @@ asc_docs_api.prototype.asc_GetViewRulers = function()
return
this
.
WordControl
.
m_bIsRuler
;
};
asc_docs_api
.
prototype
.
asc_SetDocumentUnits
=
function
(
_units
)
{
if
(
this
.
WordControl
&&
this
.
WordControl
.
m_oHorRuler
&&
this
.
WordControl
.
m_oVerRuler
)
{
this
.
WordControl
.
m_oHorRuler
.
Units
=
_units
;
this
.
WordControl
.
m_oVerRuler
.
Units
=
_units
;
}
};
asc_docs_api
.
prototype
.
SetMobileVersion
=
function
(
val
)
{
this
.
isMobileVersion
=
val
;
...
...
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