Merge lp:~fboucault/camera-app/do_not_focus_outside_viewfinder into lp:camera-app/staging

Proposed by Florian Boucault
Status: Merged
Approved by: Ugo Riboni
Approved revision: 661
Merged at revision: 661
Proposed branch: lp:~fboucault/camera-app/do_not_focus_outside_viewfinder
Merge into: lp:camera-app/staging
Diff against target: 24 lines (+9/-5)
1 file modified
ViewFinderView.qml (+9/-5)
To merge this branch: bzr merge lp:~fboucault/camera-app/do_not_focus_outside_viewfinder
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+288112@code.launchpad.net

Commit message

Only accept manual focus on points inside the viewfinder.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ugo Riboni (uriboni) wrote :

Works and looks as expected. Did you add a manual test for this to the test plan ?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ViewFinderView.qml'
2--- ViewFinderView.qml 2016-02-23 11:46:52 +0000
3+++ ViewFinderView.qml 2016-03-04 15:19:38 +0000
4@@ -60,11 +60,15 @@
5 property bool failedToConnect: false
6
7 function manualFocus(x, y) {
8- viewFinderOverlay.showFocusRing(x, y);
9- autoFocusTimer.restart();
10- focus.focusMode = Camera.FocusAuto;
11- focus.customFocusPoint = viewFinder.mapPointToSourceNormalized(Qt.point(x, y));
12- focus.focusPointMode = Camera.FocusPointCustom;
13+ var normalizedPoint = viewFinder.mapPointToSourceNormalized(Qt.point(x, y - viewFinder.y));
14+ if (normalizedPoint.x >= 0.0 && normalizedPoint.x <= 1.0 &&
15+ normalizedPoint.y >= 0.0 && normalizedPoint.y <= 1.0) {
16+ viewFinderOverlay.showFocusRing(x, y);
17+ autoFocusTimer.restart();
18+ focus.focusMode = Camera.FocusAuto;
19+ focus.customFocusPoint = normalizedPoint;
20+ focus.focusPointMode = Camera.FocusPointCustom;
21+ }
22 }
23
24 function autoFocus() {

Subscribers

People subscribed via source and target branches