Commit e24cbe8a authored by Malay Keshav's avatar Malay Keshav Committed by Commit Bot

Replaces uint32_t with double when working with scales

Zoom factors are double, but the code is using uint32_t to process them.
This patch fixes it.

Output on wayland info client:
OUTPUT0:

  connection:          internal
  device scale factor: 1.000

  geometry:
    x:                 2
    y:                 24
    physical width:    443 mm
    physical height:   264 mm
    subpixel:          unknown
    make:              unknown
    model:             unknown
    transform:         normal

  modes:
    1676x998:          60.00 Hz      current       preferred

  scales:
    0.500:
    0.750:
    1.000:             current       preferred
    1.250:
    1.500:
    1.750:
    2.000:
    2.250:
    2.500:

Bug: 836782
Change-Id: Id67582a637a67a608ae096a5fac992e8215aa47e
Component: Wayland, aura shell, scales
Reviewed-on: https://chromium-review.googlesource.com/1028217Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Commit-Queue: Malay Keshav <malaykeshav@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553586}
parent ae65b291
......@@ -2905,10 +2905,9 @@ class AuraOutput : public WaylandDisplayObserver::ScaleObserver {
bool rv = display_manager->GetActiveModeForDisplayId(display.id(),
&active_mode);
DCHECK(rv);
for (uint32_t zoom_factor :
display::GetDisplayZoomFactors(active_mode)) {
for (double zoom_factor : display::GetDisplayZoomFactors(active_mode)) {
uint32_t flags = 0;
if (zoom_factor == 1.f)
if (zoom_factor == 1.0)
flags |= ZAURA_OUTPUT_SCALE_PROPERTY_PREFERRED;
if (display_info.zoom_factor() == zoom_factor)
flags |= ZAURA_OUTPUT_SCALE_PROPERTY_CURRENT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment