Foliotek / Croppie

A Javascript Image Cropper
http://foliotek.github.io/Croppie
MIT License
2.56k stars 885 forks source link

crop dimension in chrome adding 4 pixels all around #717

Open RonAbarbanel opened 4 years ago

RonAbarbanel commented 4 years ago

Expected Behavior

Crop size should be as specified in paramters

Actual Behavior

In chrome the resulting crop size is 4 pixels larger in height and width than specified parameters

Steps to Reproduce the Problem

  1. Check the resulting size in Edge
  2. For the same crop size, check the resulting size in Chrome

solution (tested)

add:

-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;

to css for elements with a border:

.croppie-container .cr-viewport, .croppie-container .cr-resizer

and

.croppie-container .cr-resizer-vertical::after, .croppie-container .cr-resizer-horisontal::after

Example Link

Please recreate your issue using JSbin, JSFiddle, or Codepen.

Specifications