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
32ae3417
Commit
32ae3417
authored
Apr 26, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draw hover (content control)
parent
600e299f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
22 deletions
+52
-22
word/Drawing/DrawingDocument.js
word/Drawing/DrawingDocument.js
+34
-22
word/Drawing/HtmlPage.js
word/Drawing/HtmlPage.js
+18
-0
No files found.
word/Drawing/DrawingDocument.js
View file @
32ae3417
...
@@ -2121,6 +2121,7 @@ function CDrawingDocument()
...
@@ -2121,6 +2121,7 @@ function CDrawingDocument()
this
.
ContentControlObject
=
null
;
this
.
ContentControlObject
=
null
;
this
.
ContentControlObjectState
=
-
1
;
// 0 - hover, 1 - down
this
.
ContentControlObjectState
=
-
1
;
// 0 - hover, 1 - down
this
.
ContentControlObjectHover
=
{
check
:
false
,
state
:
-
1
,
id
:
-
1
};
// массивы ректов для поиска
// массивы ректов для поиска
this
.
_search_HdrFtr_All
=
[];
// Поиск в колонтитуле, который находится на всех страницах
this
.
_search_HdrFtr_All
=
[];
// Поиск в колонтитуле, который находится на всех страницах
...
@@ -3758,6 +3759,17 @@ function CDrawingDocument()
...
@@ -3758,6 +3759,17 @@ function CDrawingDocument()
this
.
DrawContentControl
=
function
(
id
,
type
,
page
,
rects
)
this
.
DrawContentControl
=
function
(
id
,
type
,
page
,
rects
)
{
{
if
(
this
.
ContentControlObjectHover
.
check
)
{
if
(
type
==
c_oContentControlTrack
.
Hover
)
{
this
.
ContentControlObjectHover
.
state
=
1
;
this
.
ContentControlObjectHover
.
id
=
id
;
}
return
;
}
if
(
!
rects
||
rects
.
length
==
0
)
if
(
!
rects
||
rects
.
length
==
0
)
return
;
return
;
...
@@ -3803,7 +3815,7 @@ function CDrawingDocument()
...
@@ -3803,7 +3815,7 @@ function CDrawingDocument()
if
(
type
==
c_oContentControlTrack
.
Hover
)
if
(
type
==
c_oContentControlTrack
.
Hover
)
{
{
ctx
.
fillStyle
=
"
rgba(235, 235, 235, 0.5)
;
"
;
ctx
.
fillStyle
=
"
rgba(235, 235, 235, 0.5)
"
;
ctx
.
fill
();
ctx
.
fill
();
}
}
ctx
.
stroke
();
ctx
.
stroke
();
...
@@ -3816,10 +3828,10 @@ function CDrawingDocument()
...
@@ -3816,10 +3828,10 @@ function CDrawingDocument()
_x
=
(
drPage
.
left
+
dKoefX
*
rect
.
X
);
_x
=
(
drPage
.
left
+
dKoefX
*
rect
.
X
);
_y
=
(
drPage
.
top
+
dKoefY
*
rect
.
Y
);
_y
=
(
drPage
.
top
+
dKoefY
*
rect
.
Y
);
_x
=
((
_x
>>
0
)
+
0.5
);
_x
=
((
_x
>>
0
)
+
0.5
)
-
15
;
_y
=
((
_y
>>
0
)
+
0.5
)
-
15
;
_y
=
((
_y
>>
0
)
+
0.5
);
ctx
.
rect
(
_x
,
_y
,
20
,
15
);
ctx
.
rect
(
_x
,
_y
,
15
,
20
);
if
(
1
==
this
.
ContentControlObjectState
)
if
(
1
==
this
.
ContentControlObjectState
)
{
{
...
@@ -3844,10 +3856,10 @@ function CDrawingDocument()
...
@@ -3844,10 +3856,10 @@ function CDrawingDocument()
overlay
.
AddRect
(
cx
,
cy
,
3
,
3
);
overlay
.
AddRect
(
cx
,
cy
,
3
,
3
);
overlay
.
AddRect
(
cx
+
5
,
cy
,
3
,
3
);
overlay
.
AddRect
(
cx
+
5
,
cy
,
3
,
3
);
overlay
.
AddRect
(
cx
+
10
,
cy
,
3
,
3
);
overlay
.
AddRect
(
cx
,
cy
+
5
,
3
,
3
);
overlay
.
AddRect
(
cx
,
cy
+
5
,
3
,
3
);
overlay
.
AddRect
(
cx
+
5
,
cy
+
5
,
3
,
3
);
overlay
.
AddRect
(
cx
+
5
,
cy
+
5
,
3
,
3
);
overlay
.
AddRect
(
cx
+
10
,
cy
+
5
,
3
,
3
);
overlay
.
AddRect
(
cx
,
cy
+
10
,
3
,
3
);
overlay
.
AddRect
(
cx
+
5
,
cy
+
10
,
3
,
3
);
ctx
.
fillStyle
=
_color2
;
ctx
.
fillStyle
=
_color2
;
ctx
.
fill
();
ctx
.
fill
();
...
@@ -3857,27 +3869,27 @@ function CDrawingDocument()
...
@@ -3857,27 +3869,27 @@ function CDrawingDocument()
ctx
.
lineTo
(
cx
+
1.5
,
cy
+
3
);
ctx
.
lineTo
(
cx
+
1.5
,
cy
+
3
);
ctx
.
moveTo
(
cx
+
6.5
,
cy
);
ctx
.
moveTo
(
cx
+
6.5
,
cy
);
ctx
.
lineTo
(
cx
+
6.5
,
cy
+
3
);
ctx
.
lineTo
(
cx
+
6.5
,
cy
+
3
);
ctx
.
moveTo
(
cx
+
11.5
,
cy
);
ctx
.
lineTo
(
cx
+
11.5
,
cy
+
3
);
ctx
.
moveTo
(
cx
+
1.5
,
cy
+
5
);
ctx
.
moveTo
(
cx
+
1.5
,
cy
+
5
);
ctx
.
lineTo
(
cx
+
1.5
,
cy
+
8
);
ctx
.
lineTo
(
cx
+
1.5
,
cy
+
8
);
ctx
.
moveTo
(
cx
+
6.5
,
cy
+
5
);
ctx
.
moveTo
(
cx
+
6.5
,
cy
+
5
);
ctx
.
lineTo
(
cx
+
6.5
,
cy
+
8
);
ctx
.
lineTo
(
cx
+
6.5
,
cy
+
8
);
ctx
.
moveTo
(
cx
+
11.5
,
cy
+
5
);
ctx
.
moveTo
(
cx
+
1.5
,
cy
+
10
);
ctx
.
lineTo
(
cx
+
11.5
,
cy
+
8
);
ctx
.
lineTo
(
cx
+
1.5
,
cy
+
13
);
ctx
.
moveTo
(
cx
+
6.5
,
cy
+
10
);
ctx
.
lineTo
(
cx
+
6.5
,
cy
+
13
);
ctx
.
moveTo
(
cx
,
cy
+
1.5
);
ctx
.
moveTo
(
cx
,
cy
+
1.5
);
ctx
.
lineTo
(
cx
+
3
,
cy
+
1.5
);
ctx
.
lineTo
(
cx
+
3
,
cy
+
1.5
);
ctx
.
moveTo
(
cx
+
5
,
cy
+
1.5
);
ctx
.
moveTo
(
cx
+
5
,
cy
+
1.5
);
ctx
.
lineTo
(
cx
+
8
,
cy
+
1.5
);
ctx
.
lineTo
(
cx
+
8
,
cy
+
1.5
);
ctx
.
moveTo
(
cx
+
10
,
cy
+
1.5
);
ctx
.
lineTo
(
cx
+
13
,
cy
+
1.5
);
ctx
.
moveTo
(
cx
,
cy
+
6.5
);
ctx
.
moveTo
(
cx
,
cy
+
6.5
);
ctx
.
lineTo
(
cx
+
3
,
cy
+
6.5
);
ctx
.
lineTo
(
cx
+
3
,
cy
+
6.5
);
ctx
.
moveTo
(
cx
+
5
,
cy
+
6.5
);
ctx
.
moveTo
(
cx
+
5
,
cy
+
6.5
);
ctx
.
lineTo
(
cx
+
8
,
cy
+
6.5
);
ctx
.
lineTo
(
cx
+
8
,
cy
+
6.5
);
ctx
.
moveTo
(
cx
+
10
,
cy
+
6.5
);
ctx
.
moveTo
(
cx
,
cy
+
11.5
);
ctx
.
lineTo
(
cx
+
13
,
cy
+
6.5
);
ctx
.
lineTo
(
cx
+
3
,
cy
+
11.5
);
ctx
.
moveTo
(
cx
+
5
,
cy
+
11.5
);
ctx
.
lineTo
(
cx
+
8
,
cy
+
11.5
);
ctx
.
strokeStyle
=
_color1
;
ctx
.
strokeStyle
=
_color1
;
ctx
.
stroke
();
ctx
.
stroke
();
...
@@ -6226,10 +6238,10 @@ function CDrawingDocument()
...
@@ -6226,10 +6238,10 @@ function CDrawingDocument()
var
dKoefY
=
(
drPage
.
bottom
-
drPage
.
top
)
/
_page
.
height_mm
;
var
dKoefY
=
(
drPage
.
bottom
-
drPage
.
top
)
/
_page
.
height_mm
;
var
rect
=
this
.
ContentControlObject
.
rects
[
0
];
var
rect
=
this
.
ContentControlObject
.
rects
[
0
];
var
_x
=
rect
.
X
;
var
_x
=
rect
.
X
-
(
15
/
dKoefX
)
;
var
_y
=
rect
.
Y
-
(
15
/
dKoefY
)
;
var
_y
=
rect
.
Y
;
var
_r
=
_x
+
(
20
/
dKoefX
)
;
var
_r
=
rect
.
X
;
var
_b
=
rect
.
Y
;
var
_b
=
rect
.
Y
+
(
20
/
dKoefY
)
;
var
_old
=
this
.
ContentControlObjectState
;
var
_old
=
this
.
ContentControlObjectState
;
if
(
pos
.
X
>
_x
&&
pos
.
X
<
_r
&&
pos
.
Y
>
_y
&&
pos
.
Y
<
_b
)
if
(
pos
.
X
>
_x
&&
pos
.
X
<
_r
&&
pos
.
Y
>
_y
&&
pos
.
Y
<
_b
)
...
@@ -6366,10 +6378,10 @@ function CDrawingDocument()
...
@@ -6366,10 +6378,10 @@ function CDrawingDocument()
var
dKoefY
=
(
drPage
.
bottom
-
drPage
.
top
)
/
_page
.
height_mm
;
var
dKoefY
=
(
drPage
.
bottom
-
drPage
.
top
)
/
_page
.
height_mm
;
var
rect
=
this
.
ContentControlObject
.
rects
[
0
];
var
rect
=
this
.
ContentControlObject
.
rects
[
0
];
var
_x
=
rect
.
X
;
var
_x
=
rect
.
X
-
(
15
/
dKoefX
)
;
var
_y
=
rect
.
Y
-
(
15
/
dKoefY
)
;
var
_y
=
rect
.
Y
;
var
_r
=
_x
+
(
20
/
dKoefX
)
;
var
_r
=
rect
.
X
;
var
_b
=
rect
.
Y
;
var
_b
=
rect
.
Y
+
(
20
/
dKoefY
)
;
var
_old
=
this
.
ContentControlObjectState
;
var
_old
=
this
.
ContentControlObjectState
;
this
.
ContentControlObjectState
=
-
1
;
this
.
ContentControlObjectState
=
-
1
;
...
...
word/Drawing/HtmlPage.js
View file @
32ae3417
...
@@ -1674,6 +1674,24 @@ function CEditorPage(api)
...
@@ -1674,6 +1674,24 @@ function CEditorPage(api)
oWordControl
.
OnUpdateOverlay
();
oWordControl
.
OnUpdateOverlay
();
}
}
if
(
!
oWordControl
.
IsUpdateOverlayOnEndCheck
)
{
var
_hoverObj
=
oWordControl
.
m_oDrawingDocument
.
ContentControlObjectHover
;
var
_oldHover
=
{
state
:
_hoverObj
.
state
,
id
:
_hoverObj
.
id
};
_hoverObj
.
check
=
true
;
_hoverObj
.
state
=
0
;
_hoverObj
.
id
=
-
1
;
oWordControl
.
m_oLogicDocument
.
DrawContentControls
(
pos
.
Page
,
pos
.
X
,
pos
.
Y
,
pos
.
Page
);
_hoverObj
.
check
=
false
;
if
(
_hoverObj
.
state
!=
_oldHover
.
state
||
_hoverObj
.
id
!=
_oldHover
.
id
)
oWordControl
.
OnUpdateOverlay
();
}
oWordControl
.
EndUpdateOverlay
();
oWordControl
.
EndUpdateOverlay
();
};
};
this
.
onMouseMove2
=
function
()
this
.
onMouseMove2
=
function
()
...
...
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