views: Fix overlay bounds outside of window (fixes #3457)
This commit is contained in:
parent
92f14410ae
commit
ffbc53a9e6
|
@ -280,18 +280,17 @@ void CefOverlayViewHost::SetOverlayBounds(const gfx::Rect& bounds) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx::Rect new_bounds = bounds;
|
// Empty bounds are not allowed.
|
||||||
|
if (bounds.IsEmpty()) {
|
||||||
// Keep the result inside the widget.
|
|
||||||
new_bounds.Intersect(window_view_->bounds());
|
|
||||||
|
|
||||||
if (new_bounds == bounds_) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds_changing_ = true;
|
bounds_changing_ = true;
|
||||||
|
bounds_ = bounds;
|
||||||
|
|
||||||
|
// Keep the result inside the widget.
|
||||||
|
bounds_.Intersect(window_view_->bounds());
|
||||||
|
|
||||||
bounds_ = new_bounds;
|
|
||||||
if (view_->size() != bounds_.size()) {
|
if (view_->size() != bounds_.size()) {
|
||||||
view_->SetSize(bounds_.size());
|
view_->SetSize(bounds_.size());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue