diff options
Diffstat (limited to 'js/record.js')
| -rw-r--r-- | js/record.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/js/record.js b/js/record.js index b3c2466..bdb5a71 100644 --- a/js/record.js +++ b/js/record.js @@ -13,7 +13,7 @@ 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 @@ -113,6 +113,7 @@ e.stopPropagation() count = _int("framecount") delay = _float("framedelay") * 1000 + offset = source.getBoundingClientRect(); console.log(count, delay) if (isNaN(count) || isNaN(delay)) return done = 0 @@ -163,7 +164,7 @@ 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() |
