tony-xlh/vision-camera-cropper

passing non integer values to cropRegion ignores the crop setting (ios, maybe android as well)

Closed this issue · 1 comments

Was passing cropRegion.left = 14.5 (non integer) then value was ignored when cropping . Full width of image was taken
I think this can be easly solved by adding Math.round inlines below. Do not think adding it there will impact performance but it can cause unexpected rounding ...
vision-camera-cropper/src/index.tsx

      cropRegionRecord["left"] = config.cropRegion.left;
      cropRegionRecord["top"] = config.cropRegion.top;
      cropRegionRecord["width"] = config.cropRegion.width;
      cropRegionRecord["height"] = config.cropRegion.height;

I am not sure why float values are not supported. Based on the code, it should be supported.