[Laszlo-checkins] r14189 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml
max@openlaszlo.org
max at openlaszlo.org
Thu Jun 18 21:33:24 PDT 2009
Author: max
Date: 2009-06-18 21:33:23 -0700 (Thu, 18 Jun 2009)
New Revision: 14189
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
Log:
Change 20090617-maxcarlson-T by maxcarlson at Bank on 2009-06-17 14:19:40 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix view.getMouse() when canvas is offset on the page
Bugs Fixed: LPP-8270 - view.getMouse('x') and view.getMouse('y') incorrect in DHTML when canvas is not at origin
Technical Reviewer: andre.bargull at udo.edu
QA Reviewer: hminsky
Details: After thinking about it, I realized that since __getPos() returns the absolute position relative to the origin, the behavior should be the same for all sprites.
Tests: See LPP-8270. I modified the testcase to have correct paths and show canvas coordinates to validate those:
<handler name="onclick">
var xPos = this.getMouse('x');
var yPos = this.getMouse('y');
Debug.write("location: ", xPos, yPos);
var xPos = canvas.getMouse('x');
var yPos = canvas.getMouse('y');
Debug.write("canvas location: ", xPos, yPos);
</handler>
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2009-06-18 18:30:15 UTC (rev 14188)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2009-06-19 04:33:23 UTC (rev 14189)
@@ -1991,12 +1991,7 @@
// TODO: don't base these metrics on the mouse position
//Debug.debug('LzSprite.getMouse', this.owner.classname, LzSprite.__rootSprite.getMouse('x'), LzSprite.__rootSprite.getMouse('y'));
var p = this.__getPos();
- if (this.isroot) {
- return {x: LzMouseKernel.__x - p.x, y: LzMouseKernel.__y - p.y};
- } else {
- var m = LzSprite.__rootSprite.getMouse();
- return {x: m.x - p.x, y: m.y - p.y};
- }
+ return {x: LzMouseKernel.__x - p.x, y: LzMouseKernel.__y - p.y};
}
/**
More information about the Laszlo-checkins
mailing list