Since the fix for #33 the crop state is kept as a % crop (onChange stores react-image-crop's percentCrop). Crop holds int values, so getCrop() rounds those percentages to whole units.
On a 4000px-wide image, 1% is 40px of granularity, and setCrop(getCrop()) visibly moves the selection. Previously onChange stored the pixel crop, so the granularity was roughly one rendered pixel.
Proposal: widen Crop's x, y, width and height from int to double. Note this changes the record's component types, so it is a breaking change for callers that read them — 1.3.0 would be the place for it.
Reported by @scardanzan while reviewing #35.
Since the fix for #33 the crop state is kept as a
%crop (onChangestores react-image-crop'spercentCrop).Cropholdsintvalues, sogetCrop()rounds those percentages to whole units.On a 4000px-wide image, 1% is 40px of granularity, and
setCrop(getCrop())visibly moves the selection. PreviouslyonChangestored the pixel crop, so the granularity was roughly one rendered pixel.Proposal: widen
Crop'sx,y,widthandheightfrominttodouble. Note this changes the record's component types, so it is a breaking change for callers that read them — 1.3.0 would be the place for it.Reported by @scardanzan while reviewing #35.