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

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

Issue 2658383002: [DevTools] Make UI.GlassPane position contentElement for different overlay controls. (Closed)
Patch Set: rebased Created 3 years, 11 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
Index: third_party/WebKit/Source/devtools/front_end/ui/Geometry.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Geometry.js b/third_party/WebKit/Source/devtools/front_end/ui/Geometry.js
index f6e0f5b1441ef83c7a808a1380ab6f6aaadc6594..d4e94f9470f378f0e38eed181e17919182f190c2 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Geometry.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Geometry.js
@@ -346,6 +346,16 @@ UI.Size = class {
this.width = width;
this.height = height;
}
+
+ /**
+ * @param {?UI.Size} size
+ * @return {!UI.Size}
+ */
+ clipTo(size) {
+ if (!size)
+ return this;
+ return new UI.Size(Math.min(this.width, size.width), Math.min(this.height, size.height));
+ }
};
/**

Powered by Google App Engine
This is Rietveld 408576698