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)); |
+ } |
}; |
/** |