Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
YM_L5_27
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
YM_L5_27
Commits
6ffeaf37
Commit
6ffeaf37
authored
Jul 08, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test:test
parent
e1f61b7c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
23 deletions
+13
-23
custom-hot-zone.component.ts
src/app/common/custom-hot-zone/custom-hot-zone.component.ts
+13
-23
No files found.
src/app/common/custom-hot-zone/custom-hot-zone.component.ts
View file @
6ffeaf37
...
@@ -100,7 +100,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -100,7 +100,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
@
Input
()
@
Input
()
set
bgItem
(
v
)
{
set
bgItem
(
v
)
{
this
.
_bgItem
=
v
;
this
.
_bgItem
=
v
;
this
.
init
();
}
}
_bgItem2
=
null
;
_bgItem2
=
null
;
...
@@ -110,7 +109,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -110,7 +109,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
@
Input
()
@
Input
()
set
bgItem2
(
v
)
{
set
bgItem2
(
v
)
{
this
.
_bgItem2
=
v
;
this
.
_bgItem2
=
v
;
this
.
init
();
}
}
onResize
(
event
)
{
onResize
(
event
)
{
...
@@ -186,23 +184,20 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -186,23 +184,20 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this
.
renderArr
.
push
(
this
.
bg
);
this
.
renderArr
.
push
(
this
.
bg
);
}
}
const
bg
=
this
.
bg
;
console
.
log
(
'
this.bgItem.url =
'
+
this
.
bgItem
.
url
);
if
(
!
this
.
bgItem
.
url
)
{
if
(
!
this
.
bgItem
.
url
)
{
callBack
();
callBack
();
return
;
return
;
}
}
bg
.
load
(
this
.
bgItem
.
url
).
then
(()
=>
{
this
.
bg
.
load
(
this
.
bgItem
.
url
).
then
(()
=>
{
const
rate1
=
this
.
canvasWidth
/
bg
.
width
;
const
rate1
=
this
.
canvasWidth
/
this
.
bg
.
width
;
const
rate2
=
this
.
canvasHeight
/
bg
.
height
;
const
rate2
=
this
.
canvasHeight
/
this
.
bg
.
height
;
const
rate
=
Math
.
min
(
rate1
,
rate2
);
const
rate
=
Math
.
min
(
rate1
,
rate2
);
bg
.
setScaleXY
(
rate
);
this
.
bg
.
setScaleXY
(
rate
);
bg
.
x
=
this
.
canvasWidth
/
2
;
this
.
bg
.
x
=
this
.
canvasWidth
/
2
;
bg
.
y
=
this
.
canvasHeight
/
2
;
this
.
bg
.
y
=
this
.
canvasHeight
/
2
;
callBack
();
callBack
();
});
});
...
@@ -214,24 +209,22 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -214,24 +209,22 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this
.
renderArr
.
push
(
this
.
bg2
);
this
.
renderArr
.
push
(
this
.
bg2
);
}
}
console
.
log
(
'
this.bgItem2.url =
'
+
this
.
bgItem2
.
url
);
const
bg2
=
this
.
bg2
;
if
(
!
this
.
bgItem2
.
url
)
{
if
(
!
this
.
bgItem2
.
url
)
{
callBack
();
callBack
();
return
;
return
;
}
}
bg2
.
load
(
this
.
bgItem2
.
url
).
then
(()
=>
{
this
.
bg2
.
load
(
this
.
bgItem2
.
url
).
then
(()
=>
{
const
rate1
=
this
.
canvasWidth
/
bg2
.
width
;
const
rate1
=
this
.
canvasWidth
/
this
.
bg2
.
width
;
const
rate2
=
this
.
canvasHeight
/
bg2
.
height
;
const
rate2
=
this
.
canvasHeight
/
this
.
bg2
.
height
;
const
rate
=
Math
.
min
(
rate1
,
rate2
);
const
rate
=
Math
.
min
(
rate1
,
rate2
);
bg2
.
setScaleXY
(
rate
);
this
.
bg2
.
setScaleXY
(
rate
);
bg2
.
alpha
=
0.5
;
this
.
bg2
.
alpha
=
0.5
;
bg2
.
x
=
this
.
canvasWidth
/
2
;
this
.
bg2
.
x
=
this
.
canvasWidth
/
2
;
bg2
.
y
=
this
.
canvasHeight
/
2
;
this
.
bg2
.
y
=
this
.
canvasHeight
/
2
;
callBack
();
callBack
();
});
});
...
@@ -452,7 +445,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -452,7 +445,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this
.
bgItem2
=
{};
this
.
bgItem2
=
{};
}
}
this
.
refreshBackground
(()
=>
{
this
.
refreshBackground
(()
=>
{
console
.
log
(
'
汪汪汪
'
)
if
(
!
this
.
hotZoneItemArr
)
{
if
(
!
this
.
hotZoneItemArr
)
{
this
.
hotZoneItemArr
=
[];
this
.
hotZoneItemArr
=
[];
}
else
{
}
else
{
...
@@ -478,8 +470,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -478,8 +470,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
const
rate
=
curBgRect
.
width
/
oldBgRect
.
width
;
const
rate
=
curBgRect
.
width
/
oldBgRect
.
width
;
console
.
log
(
'
rate:
'
,
rate
);
this
.
hotZoneArr
=
[];
this
.
hotZoneArr
=
[];
const
arr
=
this
.
hotZoneItemArr
.
concat
();
const
arr
=
this
.
hotZoneItemArr
.
concat
();
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
...
...
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