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

Unified Diff: samples-dev/swarm/swarm_ui_lib/touch/FxUtil.dart

Issue 1766533002: Untested hacks to swarm to avoid warnings. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: MouseEvent Created 4 years, 5 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 | « samples-dev/swarm/UIState.dart ('k') | samples-dev/swarm/swarm_ui_lib/touch/Scrollbar.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples-dev/swarm/swarm_ui_lib/touch/FxUtil.dart
diff --git a/samples-dev/swarm/swarm_ui_lib/touch/FxUtil.dart b/samples-dev/swarm/swarm_ui_lib/touch/FxUtil.dart
index 82d0a54f41010c63e3a118fb3254ae17ffe2a045..aa084e88adb901956bb3af5ae494fa0115bc6f7c 100644
--- a/samples-dev/swarm/swarm_ui_lib/touch/FxUtil.dart
+++ b/samples-dev/swarm/swarm_ui_lib/touch/FxUtil.dart
@@ -68,11 +68,18 @@ class FxUtil {
*/
static Coordinate computeRelativePosition(Element element, Element target) {
final testPoint = new Point(0, 0);
+ /*
final pagePoint =
window.convertPointFromNodeToPage(element, testPoint);
final pointRelativeToTarget =
window.convertPointFromPageToNode(target, pagePoint);
return new Coordinate(pointRelativeToTarget.x, pointRelativeToTarget.y);
+ */
+ // TODO(sra): Test this version that avoids the nonstandard
+ // `convertPointFromPageToNode`.
+ var eRect = element.getBoundingClientRect();
+ var tRect = target.getBoundingClientRect();
+ return new Coordinate(eRect.left - tRect.left, eRect.top - tRect.top);
}
/** Clear a -webkit-transform from an element. */
« no previous file with comments | « samples-dev/swarm/UIState.dart ('k') | samples-dev/swarm/swarm_ui_lib/touch/Scrollbar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698