Hey, would it be simpler to have the heartbeat update the splash x/y
every time the stage size changes?
On 2007-05-03, at 23:55 EDT, [EMAIL PROTECTED] wrote:
Author: max
Date: 2007-05-03 20:55:50 -0700 (Thu, 03 May 2007)
New Revision: 4898
Modified:
openlaszlo/branches/legals/WEB-INF/lps/lfc/lzpreloader.as
Log:
Change 20070503-maxcarlson-o by [EMAIL PROTECTED] on 2007-05-03
18:30:53 PDT
in /Users/maxcarlson/openlaszlo/legals-clean
for http://svn.openlaszlo.org/openlaszlo/branches/legals
Summary: Fix splash centering
New Features:
Bugs Fixed: LPP-3943 - Splash off center
Technical Reviewer: promanik
QA Reviewer: sallen
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: lzpreloader.as - test to make sure the canvas size has
stabilized before initializing the splash.
Tests: Splash positioning is solid now. Before it was often off
for soloapps,esp. in Safari. Sarah, let me know if this helps!
Files:
M WEB-INF/lps/lfc/lzpreloader.as
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070503-
maxcarlson-o.tar
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/lzpreloader.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/lzpreloader.as
2007-05-04 03:54:31 UTC (rev 4897)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/lzpreloader.as
2007-05-04 03:55:50 UTC (rev 4898)
@@ -52,6 +52,8 @@
this.synctoloads = [];
this._x = 0;
this._y = 0;
+this._lastwidth = Stage.width;
+this._lastheight = Stage.height;
// called by compiler (first thing) like:
// lzpreloader.create({attrs: {}, name: "splash", children:
@@ -116,8 +118,8 @@
// called by enterframe of the splash clip
function heartbeat (p) {
//this.mydebug('stage size ' + Stage.width + 'x' + Stage.height );
- if (this.iobj &&
- (Stage.width > 100 && Stage.height > 100)) {
+ if (this.iobj && (Stage.width > 100 && Stage.height > 100) &&
+ (Stage.width != this._lastwidth && Stage.height !=
this._lastheight)) {
// some browsers will pass 100% as 100 (or whatever %) for
first
// couple of heartbeats, ideally we would pass % from
compiler
// so we could ignore fewer cases and allow splash in
small canvas
@@ -135,6 +137,8 @@
}
//this.mydebug('percent done='+p);
}
+ this._lastwidth = Stage.width;
+ this._lastheight = Stage.height;
}
// called by the compiler (as the last instruction in the
executable),
_______________________________________________
Laszlo-checkins mailing list
[EMAIL PROTECTED]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins