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 [EMAIL PROTECTED] 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
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to