Commit 1ea07888 authored by Mohsen Izadi's avatar Mohsen Izadi Committed by Commit Bot

Clip docked magnifier layer to its bounds

The actual content rect of magnified container might be larger than its
bounds. To avoid this extra content becoming visible in the docked
magnifier, clip magnifier layer to its bounds.

BUG=947565

Change-Id: I185df56c12a2d45118b5cf35ce6240ac2b5a5fb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717540Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681443}
parent ba93610c
...@@ -743,6 +743,13 @@ void DockedMagnifierControllerImpl::CreateMagnifierViewport() { ...@@ -743,6 +743,13 @@ void DockedMagnifierControllerImpl::CreateMagnifierViewport() {
// and magnified. // and magnified.
viewport_magnifier_layer_ = viewport_magnifier_layer_ =
std::make_unique<ui::Layer>(ui::LAYER_SOLID_COLOR); std::make_unique<ui::Layer>(ui::LAYER_SOLID_COLOR);
// There are situations that the content rect for the magnified container gets
// larger than its bounds (e.g. shelf stretches beyond the screen to allow it
// being dragged up, or contents of mouse pointer might go beyond screen when
// the pointer is at the edges of the screen). To avoid this extra content
// becoming visible in the magnifier, magnifier layer should clip its contents
// to its bounds.
viewport_magnifier_layer_->SetMasksToBounds(true);
viewport_layer->Add(viewport_magnifier_layer_.get()); viewport_layer->Add(viewport_magnifier_layer_.get());
viewport_layer->SetMasksToBounds(true); viewport_layer->SetMasksToBounds(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