On 3/28/10 6:02 AM, André Bargull wrote:
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()
I decided in favor of efficiency - I did notice the curves aren't
perfect but they seem to look 'good enough' to me up to around 100
pixels. After that, things start to fall apart. Perhaps we should use
the previous implementation beyond a certain size?
And running the application from above prints the following warning in
swf8-debug:
WARNING @extensions/drawview.lzx≈1213: reference to undefined property
'_dirty'
Whoops! I'll fix that.
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