Skip to content

Commit 6bd1e8b

Browse files
authored
Merge pull request #72 from joaomoreno/main
Deploy to prod
2 parents 23b72a6 + 5ca2df7 commit 6bd1e8b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/views/preview.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ export default class PreviewView implements m.ClassComponent<PreviewViewAttrs> {
328328

329329
const onMouseMove = (event: MouseEvent) => {
330330
const to = point(event);
331-
this.crop.top = Math.max(0, Math.min(from.y, to.y));
332-
this.crop.left = Math.max(0, Math.min(from.x, to.x));
333-
this.crop.width = Math.min(this.recording.width - this.crop.left, Math.abs(from.x - to.x));
334-
this.crop.height = Math.min(this.recording.height - this.crop.top, Math.abs(from.y - to.y));
331+
this.crop.top = Math.floor(Math.max(0, Math.min(from.y, to.y)));
332+
this.crop.left = Math.floor(Math.max(0, Math.min(from.x, to.x)));
333+
this.crop.width = Math.floor(Math.min(this.recording.width - this.crop.left, Math.abs(from.x - to.x)));
334+
this.crop.height = Math.floor(Math.min(this.recording.height - this.crop.top, Math.abs(from.y - to.y)));
335335

336336
didMove = true;
337337
m.redraw();

0 commit comments

Comments
 (0)