This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
android/src/main/java/io/flutter/plugins/camera Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -974,8 +974,12 @@ private void calculateZoom(int step) {
974
974
float ratio = (float ) 1 / zoomLevel ;
975
975
int croppedWidth = rect .width () - Math .round ((float ) rect .width () * ratio );
976
976
int croppedHeight = rect .height () - Math .round ((float ) rect .height () * ratio );
977
- zoom = new Rect (croppedWidth / 2 , croppedHeight / 2 ,
978
- rect .width () - croppedWidth / 2 , rect .height () - croppedHeight / 2 );
977
+ zoom =
978
+ new Rect (
979
+ croppedWidth / 2 ,
980
+ croppedHeight / 2 ,
981
+ rect .width () - croppedWidth / 2 ,
982
+ rect .height () - croppedHeight / 2 );
979
983
}
980
984
981
985
private void setScalerCropRegion (CaptureRequest .Builder captureRequestBuilder , Rect zoom ) {
Original file line number Diff line number Diff line change @@ -165,16 +165,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome> {
165
165
IconButton (
166
166
icon: const Icon (Icons .zoom_in),
167
167
color: Colors .blue,
168
- onPressed: controller != null
169
- ? onZoomInButtonPressed
170
- : null ,
168
+ onPressed: controller != null ? onZoomInButtonPressed : null ,
171
169
),
172
170
IconButton (
173
171
icon: const Icon (Icons .zoom_out),
174
172
color: Colors .blue,
175
- onPressed: controller != null
176
- ? onZoomOutButtonPressed
177
- : null ,
173
+ onPressed: controller != null ? onZoomOutButtonPressed : null ,
178
174
),
179
175
],
180
176
);
Original file line number Diff line number Diff line change @@ -515,7 +515,7 @@ class CameraController extends ValueNotifier<CameraValue> {
515
515
}
516
516
517
517
Future <void > zoomIn () async {
518
- await _channel.invokeMethod <void >('zoomIn' );
518
+ await _channel.invokeMethod <void >('zoomIn' );
519
519
}
520
520
521
521
Future <void > zoomOut () async {
You can’t perform that action at this time.
0 commit comments