Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM5-17
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
YM5-17
Commits
7925919e
Commit
7925919e
authored
Apr 27, 2021
by
Chen Jiping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:调整滚动条显示
parent
7bd290c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
play.component.ts
src/app/play/play.component.ts
+10
-5
No files found.
src/app/play/play.component.ts
View file @
7925919e
...
...
@@ -764,7 +764,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
scrollbar
=
new
Scrollbar
();
scrollbar
.
init
(
this
.
mapScale
,
this
.
mapScale
,
viewHight
,
Math
.
floor
(
totalHeight
-
dH
),
14
);
scrollbar
.
showScrollbar
();
//
scrollbar.hide();
scrollbar
.
hide
();
scrollbar
.
bg
.
x
=
this
.
canvasWidth
/
2
+
161
*
this
.
mapScale
;
scrollbar
.
bg
.
y
=
this
.
canvasHeight
/
2
-
231
*
this
.
mapScale
;
this
.
renderArr
.
push
(
scrollbar
.
bg
);
...
...
@@ -943,7 +943,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
y
=
sentence
.
getBoundingBox
().
y
;
let
h
=
sentence
.
getBoundingBox
().
height
;
let
h
=
Math
.
floor
(
sentence
.
getBoundingBox
().
height
)
;
let
offsetY
=
Math
.
floor
(
y
-
h
/
2
);
...
...
@@ -953,16 +953,21 @@ export class PlayComponent implements OnInit, OnDestroy {
let
dH
=
24
*
this
.
mapScale
;
console
.
log
(
offsetY
,
Math
.
floor
(
this
.
initY
),
Math
.
floor
(
this
.
initY
+
this
.
sentenceBg
.
height
))
let
maxY
=
Math
.
floor
(
this
.
initY
+
this
.
sentenceBg
.
height
);
let
minY
=
Math
.
floor
(
this
.
initY
);
//如果句子不在可视窗口,则进行定位滚动
if
(
offsetY
<
Math
.
floor
(
this
.
initY
)
||
offsetY
>=
Math
.
floor
(
this
.
initY
+
this
.
sentenceBg
.
height
)){
if
(
offsetY
<
minY
||
offsetY
>=
maxY
||
(
offsetY
<
maxY
&&
offsetY
+
h
>=
maxY
)){
let
dis
=
0
;
if
(
offsetY
<
Math
.
floor
(
this
.
initY
)){
dis
=
Math
.
floor
(
this
.
initY
)
-
offsetY
;
}
else
if
(
offsetY
>=
Math
.
floor
(
this
.
initY
+
this
.
sentenceBg
.
height
)
){
dis
=
-
(
offsetY
-
Math
.
floor
(
this
.
initY
+
this
.
sentenceBg
.
height
)
+
h
+
dH
);
else
if
(
offsetY
>=
maxY
){
dis
=
-
(
offsetY
-
maxY
+
h
+
dH
);
}
this
.
sentenceBg
.
y
+=
dis
;
...
...
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