[gtk+/broadway: 223/246] broadway: Split out getPositionsFromAbsCoord from getPositionsFromEvent
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/broadway: 223/246] broadway: Split out getPositionsFromAbsCoord from getPositionsFromEvent
- Date: Tue, 15 Mar 2011 11:59:47 +0000 (UTC)
commit 27848432c7cb53c4749c9522d5296bb7875b2fe5
Author: Alexander Larsson <alexl redhat com>
Date: Fri Mar 11 21:28:39 2011 +0100
broadway: Split out getPositionsFromAbsCoord from getPositionsFromEvent
gdk/broadway/broadway.js | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/gdk/broadway/broadway.js b/gdk/broadway/broadway.js
index 7369d70..bed889f 100644
--- a/gdk/broadway/broadway.js
+++ b/gdk/broadway/broadway.js
@@ -309,19 +309,25 @@ function get_document_coordinates(element)
return res;
}
-function getPositionsFromEvent(ev, relativeId) {
+function getPositionsFromAbsCoord(absX, absY, relativeId) {
var res = Object();
- res.root_x = ev.pageX;
- res.root_y = ev.pageY;
- res.win_x = ev.pageX;
- res.win_y = ev.pageY;
+ res.root_x = absX;
+ res.root_y = absY;
+ res.win_x = absX;
+ res.win_y = absY;
if (relativeId != 0) {
- var pos = get_document_coordinates(ev.target);
+ var pos = get_document_coordinates(surfaces[relativeId].canvas);
res.win_x = res.win_x - pos.x;
res.win_y = res.win_y - pos.y;
}
+ return res;
+}
+
+function getPositionsFromEvent(ev, relativeId) {
+ var res = getPositionsFromAbsCoord(ev.pageX, ev.pageY, relativeId);
+
last_x = res.root_x;
last_y = res.root_y;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]