Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit ff3f08b

Browse files
committed
fix formatting code
1 parent 7fe7f19 commit ff3f08b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,12 @@ private void calculateZoom(int step) {
974974
float ratio = (float) 1 / zoomLevel;
975975
int croppedWidth = rect.width() - Math.round((float) rect.width() * ratio);
976976
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);
979983
}
980984

981985
private void setScalerCropRegion(CaptureRequest.Builder captureRequestBuilder, Rect zoom) {

packages/camera/example/lib/main.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,12 @@ class _CameraExampleHomeState extends State<CameraExampleHome> {
165165
IconButton(
166166
icon: const Icon(Icons.zoom_in),
167167
color: Colors.blue,
168-
onPressed: controller != null
169-
? onZoomInButtonPressed
170-
: null,
168+
onPressed: controller != null ? onZoomInButtonPressed : null,
171169
),
172170
IconButton(
173171
icon: const Icon(Icons.zoom_out),
174172
color: Colors.blue,
175-
onPressed: controller != null
176-
? onZoomOutButtonPressed
177-
: null,
173+
onPressed: controller != null ? onZoomOutButtonPressed : null,
178174
),
179175
],
180176
);

packages/camera/lib/camera.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ class CameraController extends ValueNotifier<CameraValue> {
515515
}
516516

517517
Future<void> zoomIn() async {
518-
await _channel.invokeMethod<void>('zoomIn');
518+
await _channel.invokeMethod<void>('zoomIn');
519519
}
520520

521521
Future<void> zoomOut() async {

0 commit comments

Comments
 (0)