Commit 6784a127 authored by Brandon Goddard's avatar Brandon Goddard Committed by Commit Bot

DevTools: Account for scale in CSS Grid Computed Track Labels

This cl fixes a bug where scale was not applied to the positioning
of the computed track size labels for CSS Grid overlay, causing
them to be misplaced on high dpi monitors.

Before: https://imgur.com/B970mXx

After: https://imgur.com/GLR5s2l

Bug: 1109014
Change-Id: Id762b7ef04041ff8fffe9db958dfc58585858cd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2316793
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: default avatarAlex Rudenko <alexrudenko@chromium.org>
Reviewed-by: default avatarPeter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791724}
parent 3b3ee654
...@@ -426,8 +426,8 @@ std::unique_ptr<protocol::ListValue> BuildGridTrackSizes( ...@@ -426,8 +426,8 @@ std::unique_ptr<protocol::ListValue> BuildGridTrackSizes(
direction == kForColumns ? 0 : offset); direction == kForColumns ? 0 : offset);
FloatPoint abs_arrow_pos = FloatPoint abs_arrow_pos =
layout_grid->LocalToAbsoluteFloatPoint(local_arrow_pos); layout_grid->LocalToAbsoluteFloatPoint(local_arrow_pos);
size_info->setDouble("x", abs_arrow_pos.X()); size_info->setDouble("x", abs_arrow_pos.X() * scale);
size_info->setDouble("y", abs_arrow_pos.Y()); size_info->setDouble("y", abs_arrow_pos.Y() * scale);
sizes->pushValue(std::move(size_info)); sizes->pushValue(std::move(size_info));
start += track; start += track;
i++; i++;
......
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