Commit 76dae0ec authored by Shannon Chen's avatar Shannon Chen Committed by Chromium LUCI CQ

[Switch Access] Add padding to layer and fix animation speed

Add padding to point scan layer so that both lines in range scanning
have same line width. Adjust scanning speed so that range scanning has
faster speed than line scanning.
Signed-off-by: default avatarShannon Chen <shannc@chromium.org>
Bug: 1061537
Change-Id: I90d8623bcdac226488804682ede16447f18270a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2596021
Commit-Queue: Shannon Chen <shannc@google.com>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837960}
parent 60a3ef8f
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
namespace { namespace {
// Scanning time in seconds from the start of the screen (offset_start) to the // Scanning time in seconds from the start of the screen (offset_start) to the
// end of the screen (offset_bound). // end of the screen (offset_bound).
constexpr float kHorizontalScanTimeSecs = 20; constexpr float kHorizontalScanTimeSecs = 90;
constexpr float kVerticalScanTimeSecs = 20; constexpr float kVerticalScanTimeSecs = 60;
constexpr float kHorizontalRangeScanTimeSecs = 30; constexpr float kHorizontalRangeScanTimeSecs = 30;
constexpr float kVerticalRangeScanTimeSecs = 20; constexpr float kVerticalRangeScanTimeSecs = 25;
constexpr int kDefaultRangeWidthDips = 150; constexpr int kDefaultRangeWidthDips = 150;
constexpr float kDefaultRangeHeightDips = 120; constexpr float kDefaultRangeHeightDips = 120;
......
...@@ -22,6 +22,7 @@ namespace { ...@@ -22,6 +22,7 @@ namespace {
const int kDefaultStrokeWidth = 6; const int kDefaultStrokeWidth = 6;
constexpr int kDefaultRangeWidthDips = 150; constexpr int kDefaultRangeWidthDips = 150;
constexpr int kDefaultRangeHeightDips = 120; constexpr int kDefaultRangeHeightDips = 120;
constexpr int kDefaultPaddingDips = 4;
display::Display GetPrimaryDisplay() { display::Display GetPrimaryDisplay() {
DCHECK(display::Screen::GetScreen()); DCHECK(display::Screen::GetScreen());
...@@ -42,8 +43,10 @@ PointScanLayer::PointScanLayer(AccessibilityLayerDelegate* delegate) ...@@ -42,8 +43,10 @@ PointScanLayer::PointScanLayer(AccessibilityLayerDelegate* delegate)
void PointScanLayer::StartHorizontalRangeScanning() { void PointScanLayer::StartHorizontalRangeScanning() {
is_range_scan_ = true; is_range_scan_ = true;
gfx::Point end = bounds_.bottom_left(); gfx::Point start(kDefaultPaddingDips, 0);
bounds_.set_origin(line_.start); gfx::Point end(bounds_.bottom_left().x() + kDefaultPaddingDips,
bounds_.bottom_left().y());
line_.start = start;
line_.end = end; line_.end = end;
is_moving_ = true; is_moving_ = true;
is_horizontal_range_ = true; is_horizontal_range_ = true;
...@@ -60,8 +63,10 @@ void PointScanLayer::StartHorizontalScanning() { ...@@ -60,8 +63,10 @@ void PointScanLayer::StartHorizontalScanning() {
void PointScanLayer::StartVerticalRangeScanning() { void PointScanLayer::StartVerticalRangeScanning() {
is_range_scan_ = true; is_range_scan_ = true;
gfx::Point end = bounds_.top_right(); gfx::Point start(0, kDefaultPaddingDips);
bounds_.set_origin(line_.start); gfx::Point end(bounds_.top_right().x(),
bounds_.top_right().y() + kDefaultPaddingDips);
line_.start = start;
line_.end = end; line_.end = end;
is_moving_ = true; is_moving_ = true;
} }
......
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