Author: bargull
Date: 2008-02-11 14:05:23 -0800 (Mon, 11 Feb 2008)
New Revision: 7996
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs
Log:
Change 20080206-bargull-6 by [EMAIL PROTECTED] on 2008-02-06 23:55:58
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Cleanup for stretches
New Features:
Bugs Fixed: LPP-5410 - Cleanup for "stretches"
Technical Reviewer: ptw (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
"stretches" was differently implemented in SWF compared to DHTML, especially
for null-values.
Also the docs for "stretches" and "stretchResource" did not match each other,
compared to the actual implementation.
Tests:
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2008-02-11
21:57:29 UTC (rev 7995)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2008-02-11
22:05:23 UTC (rev 7996)
@@ -1179,8 +1179,8 @@
* none (any other value).
*/
LzSprite.prototype.stretchResource = function(s) {
+ s = (s != "none" ? s : null);//convert "none" to null
if (this.stretches == s) return;
- //Debug.info('setStretches', s);
this.stretches = s;
this.__updateStretches();
}
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2008-02-11
21:57:29 UTC (rev 7995)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2008-02-11
22:05:23 UTC (rev 7996)
@@ -744,16 +744,15 @@
* the coordinate system for all children of this view, so use this method
* with care.
*
- * @param String xory: If this is defined, set the resource to stretch only
in the given axis ("width" or
- * "height"). Otherwise set the resource to stretch in both axes.
+ * @param String stretch: Set the resource to stretch only in the given axis
("width" or
+ * "height") or in both axes ("both").
*/
-LzSprite.prototype.stretchResource = function ( xory ){
- //TODO: Remove null, x, y options from here when components are moved
- if ( xory == null || xory == "x" || xory=="width" || xory=="both" ){
+LzSprite.prototype.stretchResource = function ( stretch ){
+ if (stretch == "width" || stretch == "both") {
this._setrescwidth = true;
}
- if ( xory == null || xory == "y"|| xory=="height" || xory=="both" ){
+ if (stretch == "height" || stretch == "both") {
this._setrescheight = true;
}
}
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs 2008-02-11
21:57:29 UTC (rev 7995)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs 2008-02-11
22:05:23 UTC (rev 7996)
@@ -2304,19 +2304,30 @@
* the coordinate system for all children of this view, so use this method
* with care.
*
- * @param String xory: If this is defined, set the resource to stretch only
in the given axis ("width" or
- * "height"). Otherwise set the resource to stretch in both axes.
+ * @param String stretch: Set the resource to stretch only in the given axis
("width" or
+ * "height") or in both axes ("both").
*/
-function stretchResource ( xory ){
- this.sprite.stretchResource(xory);
- //TODO: Remove null, x, y options from here when components are moved
- if ( xory == null || xory == "x" || xory=="width" || xory=="both" ){
+function stretchResource ( stretch ){
+ if (!(stretch == "none" || stretch == "both" || stretch == "width" ||
stretch == "height")) {
+ //TODO: Remove null, x, y options from here when components are moved
+ var newstretch = (stretch == null ? "both" : stretch == "x" ? "width"
: stretch == "y" ? "height" : "none");
+ if ($debug && newstretch != "none") {
+ Debug.info("%w.%s(%w) is deprecated. Use %w.%s(%w) instead.",
+ this, arguments.callee, stretch, this, arguments.callee,
newstretch);
+ }
+ stretch = newstretch;
+ }
+
+ this.stretches = stretch;
+ this.sprite.stretchResource(stretch);
+
+ if (stretch == "width" || stretch == "both") {
this._setrescwidth = true;
this.__LZcheckwidth = true;
this.reevaluateSize( "width" );
}
- if ( xory == null || xory == "y"|| xory=="height" || xory=="both" ){
+ if (stretch == "height" || stretch == "both") {
this._setrescheight = true;
this.__LZcheckheight = true;
this.reevaluateSize( "height" );
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins