File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
zxing-android-embedded/src/com/journeyapps/barcodescanner Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,17 @@ private void calculateFrames() {
387387 frameInPreview .right * previewWidth / surfaceRect .width (),
388388 frameInPreview .bottom * previewHeight / surfaceRect .height ());
389389
390- if (previewFramingRect .width () <= 0 || previewFramingRect .height () <= 0 ) {
390+ if (surfaceRect .width () != 0 && surfaceRect .height () != 0 ) {
391+ previewFramingRect = new Rect (frameInPreview .left * previewWidth / surfaceRect .width (),
392+ frameInPreview .top * previewHeight / surfaceRect .height (),
393+ frameInPreview .right * previewWidth / surfaceRect .width (),
394+ frameInPreview .bottom * previewHeight / surfaceRect .height ());
395+
396+ } else {
397+ previewFramingRect = null ;
398+ }
399+
400+ if (previewFramingRect == null || previewFramingRect .width () <= 0 || previewFramingRect .height () <= 0 ) {
391401 previewFramingRect = null ;
392402 framingRect = null ;
393403 Log .w (TAG , "Preview frame is too small" );
You can’t perform that action at this time.
0 commit comments