flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [12/16] git commit: [flex-asjs] [refs/heads/develop] - more screenXY handling
Date Mon, 05 Jan 2015 23:21:31 GMT
more screenXY handling


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b69bbf21
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b69bbf21
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b69bbf21

Branch: refs/heads/develop
Commit: b69bbf211ca30375ac41978f927e5d030b3f12c8
Parents: 726e1cd
Author: Alex Harui <aharui@apache.org>
Authored: Mon Jan 5 10:16:21 2015 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Jan 5 15:21:02 2015 -0800

----------------------------------------------------------------------
 .../beads/controllers/SliderMouseController.as  |  4 ++--
 .../controllers/VScrollBarMouseController.as    |  4 ++--
 .../org/apache/flex/core/HTMLElementWrapper.js  | 25 ++++++++++++++++++++
 3 files changed, 29 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b69bbf21/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/SliderMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/SliderMouseController.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/SliderMouseController.as
index 1568add..cca2307 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/SliderMouseController.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/SliderMouseController.as
@@ -90,7 +90,7 @@ package org.apache.flex.html.beads.controllers
 			
 			var sliderView:ISliderView = _strand.getBeadByType(ISliderView) as ISliderView;
 			
-			origin = new Point(event.stageX, event.stageY);
+			origin = new Point(event.screenX, event.screenY);
 			thumb = new Point(sliderView.thumb.x,sliderView.thumb.y);
 		}
 		
@@ -115,7 +115,7 @@ package org.apache.flex.html.beads.controllers
 		{
 			var sliderView:ISliderView = _strand.getBeadByType(ISliderView) as ISliderView;
 			
-			var deltaX:Number = event.stageX - origin.x;
+			var deltaX:Number = event.screenX - origin.x;
 			var thumbW:Number = sliderView.thumb.width/2;
 			var newX:Number = thumb.x + deltaX;
 			

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b69bbf21/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
index dbcaf7d..611f6dd 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
@@ -78,7 +78,7 @@ package org.apache.flex.html.beads.controllers
 		{
 			sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMouseMoveHandler);
 			sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_UP, thumbMouseUpHandler);
-			thumbDownY = event.stageY;
+			thumbDownY = event.screenY;
 			lastThumbY = sbView.thumb.y;
 		}
 		
@@ -86,7 +86,7 @@ package org.apache.flex.html.beads.controllers
 		{
 			var thumb:DisplayObject = sbView.thumb;
 			var track:DisplayObject = sbView.track;
-			thumb.y = Math.max(track.y, Math.min(lastThumbY + (event.stageY - thumbDownY), track.y
+ track.height - thumb.height));
+			thumb.y = Math.max(track.y, Math.min(lastThumbY + (event.screenY - thumbDownY), track.y
+ track.height - thumb.height));
 			var newValue:Number = snap((thumb.y - track.y) / (track.height - thumb.height) * (sbModel.maximum
- sbModel.minimum - sbModel.pageSize));
 			sbModel.value = newValue;
 			IEventDispatcher(strand).dispatchEvent(new Event("scroll"));

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b69bbf21/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js b/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
index aa043cd..4eca663 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
@@ -150,5 +150,30 @@ Event.prototype.get_target = function() {
  * @return {Object} The wrapping object.
  */
 goog.events.BrowserEvent.prototype.get_target = function() {
+  // if it is a faked event so just return the target
+  if (!this.event_) return this.target;
+  // for true browser events, get the embedded event's target
   return this.event_.get_target();
 };
+
+
+/**
+ * Hack to allow event.screenX expressions to work
+ *
+ * @expose
+ * @return {number} The wrapping object.
+ */
+goog.events.BrowserEvent.prototype.get_screenX = function() {
+  return this.screenX;
+};
+
+
+/**
+ * Hack to allow event.screenY expressions to work
+ *
+ * @expose
+ * @return {number} The wrapping object.
+ */
+goog.events.BrowserEvent.prototype.get_screenY = function() {
+  return this.screenY;
+};


Mime
View raw message