Change condition for creating new row during navigation 18/184818/2
authorLukasz Wlazly <l.wlazly@partner.samsung.com>
Mon, 23 Jul 2018 09:46:15 +0000 (11:46 +0200)
committerLukasz Wlazly <l.wlazly@partner.samsung.com>
Mon, 23 Jul 2018 12:38:38 +0000 (14:38 +0200)
In some cases UI widgets overlap each others with small number of
pixels. Those widgets should be seen as different rows during
navigation. New condition makes that, even if next elements starts in
3/4 of current row height, it would create new row.

Change-Id: I2b84b7b35de762365dcd95117c1fcc919f38e447

src/NavigationInterface.cpp

index 960a7335cc103c69f3e9c4a2f0b135e2916d88ae..9726fbce53369bd9fdbe4de8bbeea1e5a05b25e0 100644 (file)
@@ -191,7 +191,7 @@ private:
                                objInfo.obj = std::move(a.object);
                                objInfo.pos = a.pos;
 
-                               if (!new_line && (objInfo.pos.position.x < prev_obj_x || rowInfo.pos.position.y + rowInfo.pos.size.height <= objInfo.pos.position.y)) {
+                               if (!new_line && (objInfo.pos.position.x < prev_obj_x || 4 * (objInfo.pos.position.y - rowInfo.pos.position.y) >= 3 * rowInfo.pos.size.height)) {
                                        // new row
                                        rowInfo.last = i - 1;
                                        rowInfos.push_back(rowInfo);