Whoops - somehow that part of my change didn't get checked in. It's going in shortly. Thanks!
Regards, Max Carlson OpenLaszlo.org On 2/24/10 4:00 PM, André Bargull wrote: > Wait - the change is checked in, you're still using beginPath() etc. in > fillRect(). You can't use these methods, they are changing the current > path. And in [1] is clearly specified that this isn't allowed: >> Shapes are painted without affecting the current path, and are subject >> to the clipping region, and, with the exception of clearRect(), also >> shadow effects, global alpha, and global composition operators. > > I'm referring to this code in fillRect(): >> + // can't use fillRect() with alpha because it replaces the pixels >> + this.beginPath(); >> + this.rect(x, y, w, h); >> + this.fill(); > > Here's a simple testcase, dhtml gives the expected result, but swf fails: > > <canvas> > <drawview width="100" height="100"> > <handler name="oncontext"> > this.beginPath(); > this.strokeStyle = "#000000"; > this.fillStyle = "#AA00007F"; > this.lineTo(50,50); > this.fillRect(25,25,50,50); > this.lineTo(100,0); > this.stroke(); > </handler> > </drawview> > </canvas> > > > [1] > http://www.whatwg.org/specs/web-apps/current-work/#simple-shapes-%28rectangles%29 > > > > > On 2/25/2010 12:37 AM, Max Carlson wrote: >> Ah - okay. I removed this. Thanks again! >> >> Regards, >> Max Carlson >> OpenLaszlo.org >> >> On 2/24/10 2:42 PM, André Bargull wrote: >>>>> > -> why calling getNextHighestDepth()? >>>> Because everything (including the bitmap layer) is nested inside >>>> __drawcontainer. __drawcontainer seems to end up at the right depth, >>>> as nesting, clickable, etc. works fine. Do you see an issue with this? >>>> >>> >>> No, I don't see any issue with this. I just wondered why there was a >>> call to getNextHighestDepth() without using the return value. >>> >>> first changeset, line 1456-1460: >>>> var depth:Number = this.__drawcontainer.getNextHighestDepth(); >>>> // context and __drawcontext are the same for AS2 >>>> this.__drawcontext = this.context = this.createDrawingContext(); >>>> >>>> return this.__drawcontext; >>> >>> >>> >>> >>> >>> On 2/24/2010 10:30 PM, Max Carlson wrote: >>>> Change 20100222-maxcarlson-q by maxcarl...@bank on 2010-02-22 13:45:49 >>>> PST >>>> in /Users/maxcarlson/openlaszlo/trunk-clean >>>> for http://svn.openlaszlo.org/openlaszlo/trunk >>>> >>>> Summary: UPDATED: Fix drawview.fillRect() in dhtml/swf8/10 >>>> >>>> Bugs Fixed: LPP-8778 - Drawview.fillRect() doesn't work properly in >>>> swf or dhtml when alpha is applied >>>> >>>> Technical Reviewer: ptw >>>> QA Reviewer: [email protected] >>>> >>>> Details: Updated to address Andre's comments: >>>>> - dhtml: >>>>> -> remove "globalAlpha" handling from "__updateStyles()" >>>> >>>> Fixed. >>>> >>>>> swf: >>>>> - can't use beginPath() etc, fillRect() must not affect the current >>>>> path >>>>> [1] >>>> >>>> Fixed. >>>> >>>>> - swf8: >>>>> createContainer() >>>>> -> context menu handling broken >>>> >>>> Good catch! Fixed with a shared method that updates all drawing >>>> contexts. >>>> >>>>> -> why calling getNextHighestDepth()? >>>> >>>> Because everything (including the bitmap layer) is nested inside >>>> __drawcontainer. __drawcontainer seems to end up at the right depth, >>>> as nesting, clickable, etc. works fine. Do you see an issue with this? >>>> >>>>> -> why assigning "this.context"? >>>> >>>> You're right, this shouldn't be necessary. Fixed. >>>> >>>>> >>>>> - swf9/10: >>>>> createContainer() >>>>> -> "mouseEnabled" is set to false for __drawcontainer, but not for the >>>>> drawing context, maybe you want to use >>>>> "DisplayObjectContainer#mouseChildren" instead? >>>> >>>> Yep, that helps. Fixed. >>>> >>>>> rebuildBitmap() >>>>> -> "if (! dc) return;" - why? existence already checked right at the >>>>> beginning of the function >>>> >>>> Fixed. >>>> >>>>> >>>>> [1] >>>>> http://www.whatwg.org/specs/web-apps/current-work/#simple-shapes-%28rectangles%29 >>>>> >>>>> >>>>> >>>> >>>> Otherwise, the same. >>>> >>>> Remove unused __rrfactors attribute. DHTML's __updateFillStyle() now >>>> respects globalAlpha. swf8/10 use restructured sprite/movieclip >>>> heirarchy - now everything drawview-related goes inside a single >>>> __drawcontainer, with the __bitmapcontainer always resting behind any >>>> drawing context(s). createContainer() calls __rebuildBitmap() >>>> directly, to ensure it's placed behind any drawing contexts. >>>> fillRect() used vector graphics when alpha != 1 to avoid issue where >>>> pixel values are replaced instead of drawn on top of. >>>> >>>> Tests: Updated testcase from LPP-8778 looks consistend in dhtml, swf8 >>>> and swf10. Testcase from LPP-7823 runs as before in dhtml, swf8 and >>>> swf10. >>>> >>>> Files: >>>> M lps/components/extensions/drawview.lzx >>>> >>>> Changeset: >>>> http://svn.openlaszlo.org/openlaszlo/patches/20100222-maxcarlson-q.tar >>>> >> _______________________________________________ Laszlo-reviews mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews
