Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LianXian_plus
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
LianXian_plus
Commits
431b760a
Commit
431b760a
authored
Apr 07, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 卡片距离微调
parent
e83c8953
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
play.component.ts
src/app/play/play.component.ts
+5
-6
No files found.
src/app/play/play.component.ts
View file @
431b760a
...
...
@@ -521,16 +521,15 @@ export class PlayComponent implements OnInit, OnDestroy {
initItem
()
{
const
picArr
=
this
.
picArr
;
const
rate
=
10
;
// 距离与图片比例 10:1
const
itemWidth
=
(
this
.
canvasWidth
-
20
*
this
.
mapScale
)
/
(
picArr
.
length
+
(
picArr
.
length
-
1
)
/
rate
);
const
itemWidth
=
(
this
.
canvasWidth
-
20
*
this
.
mapScale
)
/
picArr
.
length
;
const
itemHeight
=
(
this
.
canvasHeight
-
100
*
this
.
mapScale
)
/
2
;
const
itemSideLength
=
Math
.
min
(
itemWidth
,
itemHeight
);
const
disW
=
itemSideLength
/
rate
;
const
disW
=
0
;
const
disH
=
(
this
.
canvasHeight
-
itemSideLength
*
2
-
120
*
this
.
mapScale
)
/
2
;
const
offX
=
this
.
canvasWidth
/
2
-
(
picArr
.
length
-
1
)
*
(
itemSideLength
+
disW
)
/
2
;
const
offX
=
this
.
canvasWidth
/
2
-
(
picArr
.
length
-
1
)
*
(
itemSideLength
)
/
2
;
const
offY
=
this
.
canvasHeight
/
2
+
60
*
this
.
mapScale
;
...
...
@@ -574,7 +573,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let
itemBg
=
new
MySprite
();
itemBg
.
init
(
this
.
images
.
get
(
'
item_bg
'
));
itemBg
.
setScaleXY
(
itemSideLength
/
itemBg
.
width
);
itemBg
.
x
=
offX
+
i
*
(
itemSideLength
+
disW
)
;
itemBg
.
x
=
offX
+
i
*
itemSideLength
;
itemBg
.
y
=
offY
-
(
disH
+
itemSideLength
/
2
);
let
bgRect
=
new
ShapeRect
();
...
...
@@ -623,7 +622,7 @@ export class PlayComponent implements OnInit, OnDestroy {
itemBg
=
new
MySprite
();
itemBg
.
init
(
this
.
images
.
get
(
'
item_bg
'
));
itemBg
.
setScaleXY
(
itemSideLength
/
itemBg
.
width
);
itemBg
.
x
=
offX
+
i
*
(
itemSideLength
*
((
rate
+
1
)
/
rate
))
;
itemBg
.
x
=
offX
+
i
*
itemSideLength
;
itemBg
.
y
=
offY
+
(
disH
+
itemSideLength
/
2
);
...
...
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