diff options
| author | Julie Lala <jules@okfoc.us> | 2013-12-27 17:46:41 -0500 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2013-12-27 17:46:41 -0500 |
| commit | 4750a54c0ca5d4f05f19c485dc484d6321fe76c3 (patch) | |
| tree | 8a46c98c29826da7a4f227ee8bb95b1fe4e3139c /js/record.concat.js | |
| parent | faa00174921672b8bb8bcc2532eb382932b68ac6 (diff) | |
check offset
Diffstat (limited to 'js/record.concat.js')
| -rw-r--r-- | js/record.concat.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/js/record.concat.js b/js/record.concat.js index 12af95d..2d2a615 100644 --- a/js/record.concat.js +++ b/js/record.concat.js @@ -921,7 +921,7 @@ function GifEncoder(){ var w, h, x, y; var w_el, h_el, x_el, y_el; - var last_t, frame_t, count, delay, done; + var last_t, frame_t, count, delay, offset, done; var frames = [] var curtain, outline var dragging = false @@ -1021,6 +1021,7 @@ function GifEncoder(){ e.stopPropagation() count = _int("framecount") delay = _float("framedelay") * 1000 + offset = source.getBoundingClientRect(); console.log(count, delay) if (isNaN(count) || isNaN(delay)) return done = 0 @@ -1071,7 +1072,7 @@ function GifEncoder(){ var ctx = frame.getContext('2d') ctx.fillStyle = backgroundColor() ctx.fillRect(0,0,w,h) - ctx.drawImage(source, x, y, w, h, 0, 0, w, h) + ctx.drawImage(source, x-offset.left, y-offset.top, w, h, 0, 0, w, h) } function render(){ encoder.reset() |
