With the simplification in "LzKernelUtils.rect(..)", rounded corners are
now drawn differently compared to 4.7 (and all previous versions).
Here's an example:
---
<canvas debug="true">
<drawview id="dv">
<handler name="oncontext">
this.clear();
this.rect(100,100,500,500,250);
this.fill();
</handler>
</drawview>
</canvas>
---
Only without your changes, this code draws a perfect circle. I've
attached two files for reference:
- LPP-8745.html: draws a rounded rectangle with the code from [1]
- LPP_8745.as: draws a rounded rectangle with Graphics#drawRoundRect(..) [2]
The previous implementation in LzKernelUtils produces results like
"LPP_8745.as", while the new implementation is rather like "LPP-8745.html".
But I can't say what is the expected behaviour here...
[1]
https://developer.mozilla.org/en/Canvas_tutorial/Drawing_shapes#Making_combinations
[2]
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Graphics.html#drawRoundRect()
And running the application from above prints the following warning in
swf8-debug:
WARNING @extensions/drawview.lzx≈1213: reference to undefined property
'_dirty'
On 3/25/2010 6:07 AM, Max Carlson wrote:
Change 20100324-maxcarlson-D by maxcarl...@bank on 2010-03-24 22:01:55 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Add individual corner radius to drawview.rect()
Bugs Fixed: LPP-8745 - Add support for border-radius to view (partial)
Technical Reviewer: ptw
QA Reviewer: hminsky
Details: drawing.lzx - Add example of setting individual corner radius.
LzKernelUtils - Add updated rect() routine that handles individual corner
radius.
drawview - Add additional arguments to rect().
Tests: test/drawing/drawing.lzx shows an orange box with rounded corners that
are all different sizes.
Files:
M test/drawing/drawing.lzx
M WEB-INF/lps/lfc/kernel/LzKernelUtils.lzs
M lps/components/extensions/drawview.lzx
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/20100324-maxcarlson-D.tar
package {
import flash.display.*;
public class LPP_8745 extends Sprite {
public function LPP_8745 () {
super();
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
this.doDrawRoundRect();
}
private function doDrawRoundRect():void {
var child:Shape = new Shape();
child.graphics.beginFill(0x000000);
var r:Number = 2 * 250;
child.graphics.drawRoundRect(100, 100, 500, 500, r, r);
child.graphics.endFill();
addChild(child);
}
}
}