Skip to content

Commit c976fd8

Browse files
authored
🐛 Correct sizes when using cameraQuarterTurns (#149)
1 parent 42edb43 commit c976fd8

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ that can be found in the LICENSE file. -->
44

55
# Changelog
66

7+
## 3.6.5
8+
9+
### Fixes
10+
11+
- Correct sizes when using `cameraQuarterTurns`. (#149)
12+
713
## 3.6.4
814

915
### Improvements

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: wechat_camera_picker_demo
22
description: A new Flutter project.
3-
version: 3.6.4+20
3+
version: 3.6.5+21
44
publish_to: none
55

66
environment:

lib/src/states/camera_picker_state.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ class CameraPickerState extends State<CameraPicker>
11801180
// Only call exposure point updates when the controller is initialized.
11811181
if (innerController?.value.isInitialized ?? false) {
11821182
Feedback.forTap(context);
1183-
setExposureAndFocusPoint(d.globalPosition, constraints);
1183+
setExposureAndFocusPoint(d.localPosition, constraints);
11841184
}
11851185
}
11861186

@@ -1340,6 +1340,7 @@ class CameraPickerState extends State<CameraPicker>
13401340

13411341
@override
13421342
Widget build(BuildContext context) {
1343+
final MediaQueryData mq = MediaQuery.of(context);
13431344
return AnnotatedRegion<SystemUiOverlayStyle>(
13441345
value: SystemUiOverlayStyle.light,
13451346
child: Theme(
@@ -1348,7 +1349,14 @@ class CameraPickerState extends State<CameraPicker>
13481349
color: Colors.black,
13491350
child: RotatedBox(
13501351
quarterTurns: pickerConfig.cameraQuarterTurns,
1351-
child: buildBody(context),
1352+
child: MediaQuery(
1353+
data: mq.copyWith(
1354+
size: pickerConfig.cameraQuarterTurns.isOdd
1355+
? mq.size.flipped
1356+
: mq.size,
1357+
),
1358+
child: Builder(builder: buildBody),
1359+
),
13521360
),
13531361
),
13541362
),

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: wechat_camera_picker
22
description: A camera picker based on WeChat's UI which is a separate runnable extension to wechat_assets_picker.
33
repository: https://github.com/fluttercandies/flutter_wechat_camera_picker
4-
version: 3.6.4
4+
version: 3.6.5
55

66
environment:
77
sdk: ">=2.14.0 <3.0.0"

0 commit comments

Comments
 (0)