[Laszlo-dev] For Review: Change 20090206-Philip-a. Summary: Make fgcolor/bgcolor work the same in all runtimes
P T Withington
ptw at laszlosystems.com
Fri Feb 6 13:23:14 PST 2009
Approved if:
1) File an improvement request: LzView/getColor should be deprecated.
You should just use LzView/fgcolor (which should always reflect the
last color set -- there is no need to query the sprite, as there is no
way for a sprite to spontaneously change it's color, right?) And we
already dont' have getBGColor, so why the non-parallelism? Ditto for
getColorTransform.
2) The following test case works:
<canvas>
<stylesheet>
text { color: blue }
</stylesheet>
<view fgcolor="pink">
<simplelayout />
<text>This text should be pink</text>
<text fgcolor="$style{'color'}">This text should be blue</text>
</view>
</canvas>
That is, while I should inherit my fgcolor from my parent, I have to
not inherit it if I override it with a CSS style.
If the test case does not work, then I think this is a deeper bug...
that inheritance of these attributes has to be integrated with the CSS
system.
On 2009-02-06, at 10:50EST, Philip Romanik wrote:
> Change 20090206-Philip-a by Philip at Philip-DC on 2009-02-06 10:03:38
> EST
> in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/trunk
> for http://svn.openlaszlo.org/openlaszlo/trunk
>
> Summary: Make fgcolor/bgcolor work the same in all runtimes
>
> New Features:
>
> Bugs Fixed: LPP-7481 LPP-7490
>
> Technical Reviewer: ptw
> QA Reviewer: (pending)
> Doc Reviewer: (pending)
>
> Documentation:
>
> Release Notes:
>
> Details:
> According to the docs, a view's fgcolor applies to any contained
> views. I took the approach taken by font (and fontsize, fontstyle)
> to traverse the view hierarchy in construct() to find if fgcolor was
> specified. Any runtime changes made to a parent view will not change
> fgcolor of a child.
>
> LaszloView.lzs
> - Set hasfgcolor if the view specifies fgcolor
> LzText.lzs
> - In construct(), get fgcolor from a parent
> swf/LzSprite.as
> - Don't write the fgcolor to the color transform. Doing so adjusts
> all color values (including the background).
> swf/LzTextSprite.as
> - Added getColor override because the text sprite stores the color
> differently than LzSprite.
>
>
> Tests:
> See LPP-7490 for an app. The app produces the same output in all
> runtimes. Textheight has an issue in swf9 but this is from something
> else.
> smoketest passes in all runtimes (there is one error in swf9 from
> something else).
> lzpix
>
> Files:
> M WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
> M WEB-INF/lps/lfc/kernel/swf/LzSprite.as
> M WEB-INF/lps/lfc/views/LzText.lzs
> M WEB-INF/lps/lfc/views/LaszloView.lzs
>
> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090206-Philip-a.tar
>
More information about the Laszlo-dev
mailing list