MattKetmo / darkroomjs

Extensible image editing tool in your browser
https://mattketmo.github.io/darkroomjs
MIT License
1.42k stars 405 forks source link

Small crops produce extra border around image #68

Open marcelgruber opened 8 years ago

marcelgruber commented 8 years ago

Right from the official example page itself

screen shot 2015-11-21 at 21 09 44

Though the edges get clipped off when saving the image, it does become an issue if the save plugin is turned off.

bilogic commented 8 years ago

the loaded image always has 1 extra pixel on the top and right. e.g. 199 x 199 image => 200 x 200 image suspect that problem is at canvas and viewport

garr1nch4 commented 8 years ago

Any ideas how to fix it? Always have extra top and right borders for big pictures, and left and top borders for small pictures

upd. In my case adding 2 lines after line 188 https://github.com/MattKetmo/darkroomjs/blob/master/lib/js/core/darkroom.js#L189

canvasHeight -= 2;
canvasWidth -= 2;

solve the problem