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

Key: LPP-4150
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: -- --
Assignee: Max Carlson
Reporter: Max Carlson
Votes: 0
Watchers: 0
Operations

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

drawview broken in non-IE DHTML as of r5422

Created: 15/Jun/07 04:45 PM   Updated: 27/Sep/07 08:56 AM
Component/s: Extensions - drawview
Affects Version/s: Legals
Fix Version/s: RingDing (4.1)

Time Tracking:
Not Specified

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


 Description  « Hide
I just noticed the regression...

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Robert Yeager - 18/Jun/07 12:42 PM
Also, just noticed that line 418 also causes some of my lines to be drawn in black, too in FF DHTML:

                if (this['_strokeStyle'] != this.strokeStyle) {

Seems like a similar problem. Sorry I can't provide a simple test case to demonstrate!

Max Carlson - 18/Jun/07 06:00 PM
Author: max
Date: 2007-06-16 12:12:32 -0700 (Sat, 16 Jun 2007)
New Revision: 5448

Modified:
   openlaszlo/branches/legals/lps/components/extensions/drawview.lzx
Log:
Change 20070615-maxcarlson-j by maxcarlson@plastik on 2007-06-15 16:41:33 PDT
    in /Users/maxcarlson/openlaszlo/legals-clean
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Fix drawview in non-IE DHTML

New Features:

Bugs Fixed: LPP-4150 - drawview broken in non-IE DHTML as of r5422

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

Documentation:

Release Notes:

Details: My attempt at initting at construct time for non-IE browsers didn't work out - I guess not enough of the div heirarchy is created? Anyhow, this fixes that issue. I also cache fill and linestyle values to prevent extra calls to the color conversion methods.
    

Tests: http://localhost:8080/legals-clean/lps/components/extensions/test/drawing.lzx?lzr=dhtml runs in non-IE DHTML browsers again.



Modified: openlaszlo/branches/legals/lps/components/extensions/drawview.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/extensions/drawview.lzx 2007-06-16 06:44:52 UTC (rev 5447)
+++ openlaszlo/branches/legals/lps/components/extensions/drawview.lzx 2007-06-16 19:12:32 UTC (rev 5448)
@@ -271,12 +271,9 @@
     
             function construct(parent,args) {
                 super.construct(parent, args);
- if (Lz.__BrowserDetect.isIE) {
- new LzDelegate( this , "_onconstruct" , this , "onconstruct" );
- } else {
- this._onconstruct(args);
- }
+ new LzDelegate( this , "_onconstruct" , this , "onconstruct" );
             }
+
             function _onconstruct(args) {
                 var w = args ? args['width'] : this.width;
                 var h = args ? args['height'] : this.height;
@@ -412,10 +409,16 @@
                     //Debug.write('before apply');
                     this.fillStyle.__applyTo(this.context);
                 } else {
- this.context.fillStyle = LzUtils.color.torgb(this.fillStyle);
+ if (this['_fillStyle'] != this.fillStyle) {
+ this.context.fillStyle = LzUtils.color.torgb(this.fillStyle);
+ this._fillStyle = this.fillStyle;
+ }
                 }
     
- this.context.strokeStyle = LzUtils.color.torgb(this.strokeStyle);
+ if (this['_strokeStyle'] != this.strokeStyle) {
+ this.context.strokeStyle = LzUtils.color.torgb(this.strokeStyle);
+ this._strokeStyle = this.strokeStyle;
+ }
                 this.context.globalAlpha = this.globalAlpha;
                 if (this.__path.length) {
                     this.context.beginPath();
@@ -690,7 +693,10 @@
                     //Debug.write('before apply');
                     this.fillStyle.__applyTo(this.context);
                 } else {
- this.fillStyle = LzUtils.color.hextoint(this.fillStyle);
+ if (this['_fillStyle'] != this.fillStyle) {
+ this.fillStyle = LzUtils.color.hextoint(this.fillStyle);
+ this._fillStyle = this.fillStyle;
+ }
                     //Debug.write('fill', this.context, this.fillStyle, this.globalAlpha * 100);
                     this.context.beginFill(this.fillStyle, this.globalAlpha * 100);
                 }
@@ -740,7 +746,10 @@
                     }
                     return;
                 }
- this.strokeStyle = LzUtils.color.hextoint(this.strokeStyle);
+ if (this['_strokeStyle'] != this.strokeStyle) {
+ this.strokeStyle = LzUtils.color.hextoint(this.strokeStyle);
+ this._strokeStyle = this.strokeStyle;
+ }
                 var m = this.context;
                 m.lineStyle(this.lineWidth, this.strokeStyle, this.globalAlpha * 100);
                 //Debug.write(m, 'stroke',this.lineWidth, this.strokeStyle, this.globalAlpha * 100);


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