History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-4357
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P0 P0
Assignee: Unassigned
Reporter: Arnaldo M
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

getMouse returns absolute coordinates in DHTML + FF

Created: 24/Jul/07 06:41 AM   Updated: 01/Nov/07 03:18 PM
Component/s: Components - base
Affects Version/s: 4.0.2
Fix Version/s: RingDing (4.1)

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 5,773
Fixed in branch: branches/legals
Runtime: N/A
Fix in hand: False


 Description  « Hide
The method view.getMouse() should return the position of the mouse relative to the view. Although, when compiling the following code to DHTML and running it on Firefox, one can observe that this method returns the position of the mouse relative to the canvas.

<canvas>
  <view width="100" height="100" x="400" y="400" bgcolor="0xFFFF00">
    <attribute name="mouseX" value="${getMouse('x')}"/>
    <attribute name="mouseY" value="${getMouse('y')}"/>
    <text text="${parent.mouseX+':'+parent.mouseY}"/>
  </view>
</canvas>

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Max Carlson - 24/Jul/07 03:38 PM
Author: max
Date: 2007-07-24 15:37:23 -0700 (Tue, 24 Jul 2007)
New Revision: 5773

Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
Log:
Change 20070724-maxcarlson-8 by maxcarlson@plastik on 2007-07-24 13:09:36 PDT
    in /Users/maxcarlson/openlaszlo/legals-checkin
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Fix sprite position caching during early initiialization

New Features:

Bugs Fixed: LPP-4357 - getMouse returns absolute coordinates in DHTML + FF

Technical Reviewer: promanik
QA Reviewer: jcrowley
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: LzSprite.js - Only set __poscachedirty if the sprite has a __parent attached. Otherwise, the position will be cached too early - before the sprite is attached to the DOM. This yields a nice speedup and resolves the issue with lpp-4120.

Tests: Tested LPP-4120, LPP-4357 testcases in Safari, Firefox 2 and IE 7.



Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2007-07-24 20:19:10 UTC (rev 5772)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2007-07-24 22:37:23 UTC (rev 5773)
@@ -1269,15 +1269,12 @@
         }
     }
 
- /* This breaks in firefox - see LPP-4120
- // set this and parent's dirty to false
+ // set this and parents' __poscachedirty to false
     var p = this;
- while (p != this.__rootSprite) {
- p.__poscachedirty = false;
+ while (p && p != this.__rootSprite) {
+ if (p.__parent) p.__poscachedirty = false;
         p = p.__parent;
     }
- */
- this.__poscachedirty = false;
     this.__poscache = pos;
     return pos;
 }


_______________________________________________
Laszlo-checkins mailing list
Laszlo-checkins@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Benjamin Shine - 10/Sep/07 09:23 PM
Fix was checked in to wafflecone, so I'm marking it as fix-version wafflecone

Steve O'Sullivan - 01/Nov/07 03:18 PM
Tested in r7050, Windows XP SP 2 FF 2.0.0.8 dhtml. Coordinates are now relative to the view as opposed to relative to the canvas.