Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1191)

Unified Diff: chrome/browser/android/vr_shell/ui_scene_manager.cc

Issue 2960493003: VR: Properly space multiple system indicators across the screen. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/ui_scene_manager.cc
diff --git a/chrome/browser/android/vr_shell/ui_scene_manager.cc b/chrome/browser/android/vr_shell/ui_scene_manager.cc
index 3a4b2e058eeb980cc182aaad6de3418d00aca050..a435bf50fd2d5c5316b83e875fb8afc517e4a1df 100644
--- a/chrome/browser/android/vr_shell/ui_scene_manager.cc
+++ b/chrome/browser/android/vr_shell/ui_scene_manager.cc
@@ -596,10 +596,13 @@ void UiSceneManager::ConfigureIndicators() {
// Position elements dynamically relative to each other, based on which
// indicators are showing, and how big each one is.
- float total_width = kIndicatorGap * (system_indicators_.size() - 1);
+ float total_width = 0;
for (const UiElement* indicator : system_indicators_) {
- if (indicator->visible())
+ if (indicator->visible()) {
+ if (total_width > 0)
+ total_width += kIndicatorGap;
total_width += indicator->size().x();
+ }
}
float x_position = -total_width / 2;
for (UiElement* indicator : system_indicators_) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698