There is an entry for the backgroundrepeat setter in the reference, the
setter needs to marked with "@access private" to avoid that entry:
http://labs.openlaszlo.org/trunk-nightly/docs/reference/lz.view.html#LzView.prototype.$lzc$set_backgroundrepeat
The "stretches-backgroundrepeat" checks aren't right:
1) the stretches setter calls "this.$lzc$set_backgroundrepeat(false)",
but false is an invalid argument
2)
> + if (backgroundrepeat && this.stretches != 'none') {
> + if ($debug) Debug.warn("Backgroundrepeat and stretches can't be
> on at the same time. Canceling stretches.", this);
> + this.$lzc$set_stretches('none');
> + }
> + // The kernel expects null for no backgroundrepeat
> + if (backgroundrepeat == 'norepeat') backgroundrepeat = null;
The conversion from 'norepeat' to null must be placed before the
stretches check, otherwise if backgroundrepeat is set to 'norepeat', the
debug warning is printed.
3)
> +function $lzc$set_backgroundrepeat( backgroundrepeat = null ){
> + this.backgroundrepeat = backgroundrepeat
The attribute must be set after the stretches setter is called when
canceling stretches. Otherwise the stretches setter cancels
backgroundrepeat, too.
Here's a simple testcase:
<canvas debug="true">
<view stretches="both" backgroundrepeat="norepeat" />
</canvas>
On 2/13/2010 4:27 AM, Max Carlson wrote:
> Change 20090428-maxcarlson-7 by maxcarl...@bank on 2009-04-28 14:33:57 PDT
> in /Users/maxcarlson/openlaszlo/trunk-clean
> for http://svn.openlaszlo.org/openlaszlo/trunk
>
> Summary: UPDATE AGAIN: Add support for resource backgroundrepeat to swf and
> dhtml runtimes
>
> New Features: Views now support a 'backgroundrepeat' attribute. Note that
> backgroundrepeat and stretches can't be set at the same time.
>
> Bugs Fixed: LPP-7714 - Components: DHTML implementation for backgroundrepeat,
> LPP-7715 - Components: Tiling - bitmap fill support
>
> Technical Reviewer: [email protected]
> QA Reviewer: hminsky
>
> Details: Updated again to address Andre's concerns:
>
> LzSprite (swf8):
> - The tiling-bitmap isn't disposed when tiling is set to false.
> fixed
> - Do you need to dispose the tiling-bitmap on destroy?
> yes - good catch!
> - Q: Why do you need to call updateTiling() for stop()?
> So tiling can be updated for multiframe resources.
>
> LzView:
> - Why do you install a default argument for the tiling setter?
> This has been removed.
>
> LzSprite (dhtml):
> - setting "tiling" to false sends on "onload"-event, it doesn't get send in
> swf8
> Fixed.
>
> Still open from last review:
> DHTML:
> - There is currently no support for reporting image loading failures. In fact
> there is even an 'onload' event although the image-url was invalid.
> This is a general issue, also for css sprites. Filed as
> http://jira.openlaszlo.org/jira/browse/LPP-8767
>
> And:
> General Question: Don't we also want to support repeat/tiling on a specific
> axis instead of just repeat-both?
> Yes! I added this, and I added support for swf9/10.
>
> LzMakeLoadSprite.as - Update the background on unload.
>
> LzSprite.as - Add backgroundrepeat capability, set to true. If
> backgroundrepeat, update on setWidth(), setHeight() stop() and unload(). Add
> implementation of setBackgroundRepeat() to be called by view. Destroy
> __repeatbitmap on destroy().
>
> LzSprite.js - Add backgroundrepeat capability, set to true. Refactor img tag
> creating logic to shared method. Add backgroundrepeat setup to setSource().
> If backgroundrepeat, update on setWidth(), setHeight() and frame updates and
> unload. Add implementation of setBackgroundRepeat() to be called by view.
>
> LaszloView.lzs - Add backgroundrepeat property, setter and onbackgorunrepeat
> event. Add warning to stretches setter and turn off backgroundrepeat if
> backgroundrepeat is on. Add backgroundrepeat property, setter which calls
> sprites - warn if stretches is on, and turn off when setting backgroundrepeat
> .
>
> Tests: See LPP-7714 for a testcase which should work in DHTML and swf.
>
> Files:
> M WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as
> M WEB-INF/lps/lfc/kernel/swf/LzSprite.as
> M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
> M WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
> M WEB-INF/lps/lfc/views/LaszloView.lzs
>
> Changeset:
> http://svn.openlaszlo.org/openlaszlo/patches/20090428-maxcarlson-7.tar
>
_______________________________________________
Laszlo-reviews mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews