Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js

Issue 2695803003: [DevTools] Fix GlassPane choosing anchor side. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js b/third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js
index 4932f117ef7afd0ce88d1e06151615bce54d57a2..2d365cf5b41520c90fd16d3150125c1fa0b3d9de 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js
@@ -129,9 +129,9 @@ UI.GlassPane = class {
if (behavior === UI.GlassPane.AnchorBehavior.PreferTop || behavior === UI.GlassPane.AnchorBehavior.PreferBottom) {
var top = anchorBox.y - gutterSize;
var bottom = containerHeight - anchorBox.y - anchorBox.height - gutterSize;
- if (behavior === UI.GlassPane.AnchorBehavior.PreferTop && top < height && bottom >= height)
+ if (behavior === UI.GlassPane.AnchorBehavior.PreferTop && top < height && bottom > top)
behavior = UI.GlassPane.AnchorBehavior.PreferBottom;
- if (behavior === UI.GlassPane.AnchorBehavior.PreferBottom && bottom < height && top >= height)
+ if (behavior === UI.GlassPane.AnchorBehavior.PreferBottom && bottom < height && top > bottom)
behavior = UI.GlassPane.AnchorBehavior.PreferTop;
positionX = Math.max(gutterSize, Math.min(anchorBox.x, containerWidth - width - gutterSize));
@@ -146,9 +146,9 @@ UI.GlassPane = class {
} else {
var left = anchorBox.x - gutterSize;
var right = containerWidth - anchorBox.x - anchorBox.width - gutterSize;
- if (behavior === UI.GlassPane.AnchorBehavior.PreferLeft && left < width && right >= width)
+ if (behavior === UI.GlassPane.AnchorBehavior.PreferLeft && left < width && right > left)
behavior = UI.GlassPane.AnchorBehavior.PreferRight;
- if (behavior === UI.GlassPane.AnchorBehavior.PreferRight && right < width && left >= width)
+ if (behavior === UI.GlassPane.AnchorBehavior.PreferRight && right < width && left > right)
behavior = UI.GlassPane.AnchorBehavior.PreferLeft;
positionY = Math.max(gutterSize, Math.min(anchorBox.y, containerHeight - height - gutterSize));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698