Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d384731 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

getDisplayViewportByType doesn't count more than one viewport

Bug: none
Test: none
Change-Id: I795f14bb1d7bd7f62a0d2a6eb301f3cced4f5109
parent f6d07ae9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -114,8 +114,10 @@ std::optional<DisplayViewport> InputReaderConfiguration::getDisplayViewportByTyp
    std::optional<DisplayViewport> result = std::nullopt;
    for (const DisplayViewport& currentViewport : mDisplays) {
        // Return the first match
        if (currentViewport.type == type && !result) {
        if (currentViewport.type == type) {
            if (!result) {
                result = std::make_optional(currentViewport);
            }
            count++;
        }
    }