Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PicturePuzzle
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
PicturePuzzle
Commits
df5698d3
Commit
df5698d3
authored
Mar 14, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
b77497c0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
21 deletions
+12
-21
Unit.ts
src/app/common/custom-hot-zone/Unit.ts
+2
-1
custom-hot-zone.component.html
...app/common/custom-hot-zone/custom-hot-zone.component.html
+2
-2
custom-hot-zone.component.scss
...app/common/custom-hot-zone/custom-hot-zone.component.scss
+1
-1
custom-hot-zone.component.ts
src/app/common/custom-hot-zone/custom-hot-zone.component.ts
+6
-16
play.component.ts
src/app/play/play.component.ts
+1
-1
No files found.
src/app/common/custom-hot-zone/Unit.ts
View file @
df5698d3
...
@@ -506,10 +506,11 @@ export class HotZoneImageItem extends MySprite {
...
@@ -506,10 +506,11 @@ export class HotZoneImageItem extends MySprite {
arrowTop
;
arrowTop
;
arrowRight
;
arrowRight
;
init
(
image_url
=
null
,
callback
?){
init
(
image_url
=
null
,
callback
?
,
handleSave
?
){
this
.
showImage
(
image_url
,
(
img
)
=>
{
this
.
showImage
(
image_url
,
(
img
)
=>
{
callback
&&
callback
(
img
.
width
,
img
.
height
)
callback
&&
callback
(
img
.
width
,
img
.
height
)
this
.
setSize
(
img
.
width
*
this
.
image
.
scaleX
,
img
.
height
*
this
.
image
.
scaleY
)
this
.
setSize
(
img
.
width
*
this
.
image
.
scaleX
,
img
.
height
*
this
.
image
.
scaleY
)
handleSave
&&
handleSave
()
this
.
lineDashFlag
=
true
;
this
.
lineDashFlag
=
true
;
this
.
showLineDash
()
this
.
showLineDash
()
this
.
showLabel
();
this
.
showLabel
();
...
...
src/app/common/custom-hot-zone/custom-hot-zone.component.html
View file @
df5698d3
...
@@ -50,11 +50,11 @@
...
@@ -50,11 +50,11 @@
</div>
</div>
<div
style=
"float: left; display: flex; flex-direction: column; padding-left: 10px;"
>
<div
style=
"float: left; display: flex; flex-direction: column; padding-left: 10px;"
>
<button
style=
"flex:1; margin-bottom: 5px;"
nz-button
nzType=
"dashed"
(
click
)="
handleMoveItemUp
($
event
,
i
)"
>
<button
style=
"flex:1; margin-bottom: 5px;"
nz-button
nzType=
"dashed"
(
click
)="
handleMoveItemUp
($
event
,
i
)"
[
disabled
]="
i=
=0"
>
<i
nz-icon
nzType=
"up"
nzTheme=
"outline"
></i>
<i
nz-icon
nzType=
"up"
nzTheme=
"outline"
></i>
上移
上移
</button>
</button>
<button
style=
"flex:1; margin-bottom: 5px;"
nz-button
nzType=
"dashed"
(
click
)="
handleMoveItemDown
($
event
,
i
)"
>
<button
style=
"flex:1; margin-bottom: 5px;"
nz-button
nzType=
"dashed"
(
click
)="
handleMoveItemDown
($
event
,
i
)"
[
disabled
]="
i=
=hotZoneArr.length-1"
>
<i
nz-icon
nzType=
"down"
nzTheme=
"outline"
></i>
<i
nz-icon
nzType=
"down"
nzTheme=
"outline"
></i>
下移
下移
</button>
</button>
...
...
src/app/common/custom-hot-zone/custom-hot-zone.component.scss
View file @
df5698d3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
border-radius
:
0
.5rem
;
border-radius
:
0
.5rem
;
min-width
:
1
0
00px
;
min-width
:
1
2
00px
;
border
:
2px
solid
#ddd
;
border
:
2px
solid
#ddd
;
.preview-box
{
.preview-box
{
margin
:
auto
;
margin
:
auto
;
...
...
src/app/common/custom-hot-zone/custom-hot-zone.component.ts
View file @
df5698d3
...
@@ -219,23 +219,20 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -219,23 +219,20 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
item
.
scaleY
=
(
saveData
.
rect
.
height
/
saveData
.
scale
)
/
h
;
item
.
scaleY
=
(
saveData
.
rect
.
height
/
saveData
.
scale
)
/
h
;
item
.
x
=
saveRect
.
x
/
saveData
.
scale
+
newRect
.
x
item
.
x
=
saveRect
.
x
/
saveData
.
scale
+
newRect
.
x
item
.
y
=
saveRect
.
y
/
saveData
.
scale
+
newRect
.
y
item
.
y
=
saveRect
.
y
/
saveData
.
scale
+
newRect
.
y
console
.
log
(
saveRect
.
x
,
saveRect
.
y
,
saveData
.
scale
)
console
.
log
(
item
.
x
,
item
.
y
,
saveData
.
scale
)
if
(
saveData
.
media
.
image_url
.
indexOf
(
"
bg_200_200
"
)
==
-
1
){
item
.
image_url
=
saveData
.
media
.
image_url
}
});
});
item
.
image_url
=
saveData
.
media
.
image_url
item
.
audio_url
=
saveData
.
media
.
audio_url
item
.
audio_url
=
saveData
.
media
.
audio_url
item
.
card_audio_url
=
saveData
.
media
.
card_audio_url
item
.
card_audio_url
=
saveData
.
media
.
card_audio_url
}
else
{
}
else
{
item
.
init
(
"
assets/default/bg_200_200.png
"
,
()
=>
{
item
.
init
(
"
assets/default/bg_200_200.png
"
,
()
=>
{
item
.
image_url
=
"
assets/default/bg_200_200.png
"
item
.
image_url
=
"
assets/default/bg_200_200.png
"
});
item
.
x
=
this
.
canvasWidth
/
2
-
100
;
item
.
y
=
this
.
canvasHeight
/
2
-
100
;
},()
=>
this
.
autoSave
());
}
}
item
.
anchorX
=
0.5
;
item
.
anchorX
=
0.5
;
item
.
anchorY
=
0.5
;
item
.
anchorY
=
0.5
;
item
.
x
=
this
.
canvasWidth
/
2
-
100
;
item
.
y
=
this
.
canvasHeight
/
2
-
100
;
return
item
;
return
item
;
}
}
...
@@ -268,6 +265,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -268,6 +265,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}
else
{
}
else
{
item
.
showLineDash
();
item
.
showLineDash
();
}
}
this
.
autoSave
()
})
})
return
item
;
return
item
;
}
}
...
@@ -320,7 +318,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -320,7 +318,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
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
++
)
{
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
arr
[
i
]));
const
data
=
JSON
.
parse
(
JSON
.
stringify
(
arr
[
i
]));
console
.
log
(
rate
)
data
.
rect
.
x
*=
rate
;
data
.
rect
.
x
*=
rate
;
data
.
rect
.
y
*=
rate
;
data
.
rect
.
y
*=
rate
;
data
.
rect
.
width
*=
rate
;
data
.
rect
.
width
*=
rate
;
...
@@ -338,7 +335,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -338,7 +335,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
initImgArr
()
{
initImgArr
()
{
// console.log('this.imgItemArr: ', this.imgItemArr);
let
curBgRect
;
let
curBgRect
;
if
(
this
.
bg
)
{
if
(
this
.
bg
)
{
curBgRect
=
this
.
bg
.
getBoundingBox
();
curBgRect
=
this
.
bg
.
getBoundingBox
();
...
@@ -352,9 +348,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -352,9 +348,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
.
imgArr
=
[];
this
.
imgArr
=
[];
const
arr
=
this
.
imgItemArr
.
concat
();
const
arr
=
this
.
imgItemArr
.
concat
();
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
...
@@ -381,7 +374,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -381,7 +374,6 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
initData
()
{
initData
()
{
this
.
canvasWidth
=
this
.
wrap
.
nativeElement
.
clientWidth
;
this
.
canvasWidth
=
this
.
wrap
.
nativeElement
.
clientWidth
;
this
.
canvasHeight
=
(
this
.
wrap
.
nativeElement
.
clientWidth
/
2
)
*
3
;
this
.
canvasHeight
=
(
this
.
wrap
.
nativeElement
.
clientWidth
/
2
)
*
3
;
console
.
log
(
this
.
canvasWidth
,
this
.
canvasHeight
)
this
.
scale
=
200
/
this
.
wrap
.
nativeElement
.
clientWidth
this
.
scale
=
200
/
this
.
wrap
.
nativeElement
.
clientWidth
this
.
mapScale
=
this
.
canvasWidth
/
this
.
canvasBaseW
;
this
.
mapScale
=
this
.
canvasWidth
/
this
.
canvasBaseW
;
this
.
renderArr
=
[];
this
.
renderArr
=
[];
...
@@ -674,10 +666,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
...
@@ -674,10 +666,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
const
currentY
=
hotZoneItem
[
'
rect
'
].
y
const
currentY
=
hotZoneItem
[
'
rect
'
].
y
hotZoneItem
[
'
media
'
]
=
{}
hotZoneItem
[
'
media
'
]
=
{}
hotZoneItem
[
'
scale
'
]
=
this
.
scale
hotZoneItem
[
'
scale
'
]
=
this
.
scale
console
.
log
((
Math
.
round
(
(
currentX
-
bgItem
[
'
rect
'
].
x
)
*
100
)
/
100
)
,
(
Math
.
round
(
(
currentY
-
bgItem
[
'
rect
'
].
y
)
*
100
)
/
100
),
this
.
scale
)
hotZoneItem
[
'
rect
'
].
x
=
(
Math
.
round
(
(
currentX
-
bgItem
[
'
rect
'
].
x
)
*
100
)
/
100
)
*
this
.
scale
;
hotZoneItem
[
'
rect
'
].
x
=
(
Math
.
round
(
(
currentX
-
bgItem
[
'
rect
'
].
x
)
*
100
)
/
100
)
*
this
.
scale
;
hotZoneItem
[
'
rect
'
].
y
=
(
Math
.
round
(
(
currentY
-
bgItem
[
'
rect
'
].
y
)
*
100
)
/
100
)
*
this
.
scale
;
hotZoneItem
[
'
rect
'
].
y
=
(
Math
.
round
(
(
currentY
-
bgItem
[
'
rect
'
].
y
)
*
100
)
/
100
)
*
this
.
scale
;
console
.
log
(
hotZoneItem
[
'
rect
'
].
x
,
hotZoneItem
[
'
rect
'
].
y
)
hotZoneItem
[
'
rect
'
].
width
=
(
Math
.
round
(
(
hotZoneItem
[
'
rect
'
].
width
)
*
100
)
/
100
)
*
this
.
scale
;
hotZoneItem
[
'
rect
'
].
width
=
(
Math
.
round
(
(
hotZoneItem
[
'
rect
'
].
width
)
*
100
)
/
100
)
*
this
.
scale
;
hotZoneItem
[
'
rect
'
].
height
=
(
Math
.
round
(
(
hotZoneItem
[
'
rect
'
].
height
)
*
100
)
/
100
)
*
this
.
scale
;
hotZoneItem
[
'
rect
'
].
height
=
(
Math
.
round
(
(
hotZoneItem
[
'
rect
'
].
height
)
*
100
)
/
100
)
*
this
.
scale
;
hotZoneItem
[
'
media
'
].
image_url
=
hotZoneArr
[
i
].
image_url
hotZoneItem
[
'
media
'
].
image_url
=
hotZoneArr
[
i
].
image_url
...
...
src/app/play/play.component.ts
View file @
df5698d3
...
@@ -453,7 +453,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -453,7 +453,7 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
ref
.
y
=
parent
.
originY
+
item
.
rect
.
y
/
parent
.
contentScale
+
(
element
.
ref
.
height
*
element
.
ref
.
scaleY
/
2
)
element
.
ref
.
y
=
parent
.
originY
+
item
.
rect
.
y
/
parent
.
contentScale
+
(
element
.
ref
.
height
*
element
.
ref
.
scaleY
/
2
)
this
.
g_cartoon
.
getCartoonElement
(
"
quertion-image-container
"
).
ref
.
addChild
(
element
.
ref
)
this
.
g_cartoon
.
getCartoonElement
(
"
quertion-image-container
"
).
ref
.
addChild
(
element
.
ref
)
element
.
cardIndex
=
index
;
element
.
cardIndex
=
index
;
element
.
ref
.
alpha
=
1
;
element
.
ref
.
alpha
=
0
;
element
.
card_audio
=
item
.
media
.
card_audio_url
element
.
card_audio
=
item
.
media
.
card_audio_url
element
.
currentClick
=
false
;
element
.
currentClick
=
false
;
element
.
isPlaced
=
false
;
element
.
isPlaced
=
false
;
...
...
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