diff options
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() |
