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

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

Issue 2773173002: [DevTools] Enable full-size screenshots (Closed)
Patch Set: works, but not sharp Created 3 years, 9 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 | « third_party/WebKit/Source/devtools/front_end/sdk/ScreenCaptureModel.js ('k') | 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/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 d4e94f9470f378f0e38eed181e17919182f190c2..b66d2b85676fce8804d101501d68a46cc4104121 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Geometry.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Geometry.js
@@ -356,6 +356,14 @@ UI.Size = class {
return this;
return new UI.Size(Math.min(this.width, size.width), Math.min(this.height, size.height));
}
+
+ /**
+ * @param {number} scale
+ * @return {!UI.Size}
+ */
+ scale(scale) {
+ return new UI.Size(this.width * scale, this.height * scale);
+ }
};
/**
@@ -465,6 +473,22 @@ UI.Rect = class {
size() {
return new UI.Size(this.width, this.height);
}
+
+ /**
+ * @param {!UI.Rect} origin
+ * @return {!UI.Rect}
+ */
+ relativeTo(origin) {
+ return new UI.Rect(this.left - origin.left, this.top - origin.top, this.width, this.height);
+ }
+
+ /**
+ * @param {!UI.Rect} origin
+ * @return {!UI.Rect}
+ */
+ rebaseTo(origin) {
+ return new UI.Rect(this.left + origin.left, this.top + origin.top, this.width, this.height);
+ }
};
/**
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sdk/ScreenCaptureModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698