Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
MAC_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
오윤석
2021-05-21 21:41:26 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f00acddeb2879efb8b372bec2b14f5720500dbc3
f00acdde
1 parent
6b4d7aea
event 추가
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
src/gif-generator/examples/tui/index.html
src/gif-generator/src/index.js
src/gif-generator/examples/tui/index.html
View file @
f00acdd
...
...
@@ -59,11 +59,12 @@
imageEditor
.
ui
.
resizeEditor
();
};
console
.
log
(
'imageeiasdfasdf'
,
imageEditor
)
console
.
log
(
"imageeiasdfasdf"
,
imageEditor
);
let
gifGenerator
;
setTimeout
(
function
()
{
gifGenerator
=
new
GifGenerator
(
imageEditor
.
_graphics
.
getCanvas
());
gifGenerator
.
on
(
"progress"
,
(
p
)
=>
console
.
log
(
p
));
},
1000
);
function
render
()
{
gifGenerator
.
make
().
then
(
...
...
src/gif-generator/src/index.js
View file @
f00acdd
...
...
@@ -7,6 +7,7 @@ export class GifGenerator {
this
.
canvas
=
canvas
;
this
.
width
=
canvas
.
getWidth
();
this
.
height
=
canvas
.
getHeight
();
this
.
events
=
{};
this
.
_initializeGif
();
}
...
...
@@ -19,6 +20,12 @@ export class GifGenerator {
repeat
:
0
,
setQuality
:
10
,
});
Object
.
keys
(
this
.
events
).
map
((
event
)
=>
{
this
.
events
[
event
].
map
((
callback
)
=>
{
this
.
gif
.
on
(
event
,
callback
);
});
});
}
_addFrame
(
delay
=
0
)
{
...
...
@@ -32,6 +39,11 @@ export class GifGenerator {
this
.
gif
.
render
();
}
on
(
event
,
callback
)
{
if
(
!
this
.
events
[
event
])
this
.
events
[
event
]
=
[];
this
.
events
[
event
].
push
(
callback
);
}
make
()
{
this
.
_initializeGif
();
...
...
Please
register
or
login
to post a comment