Skip to content

Commit 7a3aa45

Browse files
committed
merged latest lwf.
1 parent 1138fe7 commit 7a3aa45

4 files changed

Lines changed: 32 additions & 21 deletions

File tree

examples/05_template/js/lwf.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Publish for LWF.jsfl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ function warn(msg)
3939

4040
function main()
4141
{
42+
var enableWarningRecompressed = fl.tools.shiftIsDown;
43+
4244
message = "";
4345
fl.outputPanel.clear();
4446
fl.showIdleMessage(false);
@@ -87,13 +89,13 @@ function main()
8789
var libitems = [];
8890
for (var i = 0; i < items.length; ++i) {
8991
var item = items[i];
90-
if (item.name.match(/__IGNORE__/) !== null)
91-
continue;
9292
switch (item.itemType) {
9393
case "bitmap":
9494
case "movie clip":
9595
case "button":
9696
clearLinkage(item);
97+
if (item.name.match(/__IGNORE__/) !== null)
98+
continue;
9799
libitems.push(item);
98100
}
99101
}
@@ -114,7 +116,9 @@ function main()
114116
if (item.sourceFileExists) {
115117
FLfile.copy(item.sourceFilePath, bitmapDir + name);
116118
} else {
117-
warn("Image \"" + name + "\" recompressed by Flash");
119+
if (enableWarningRecompressed) {
120+
warn("Image \"" + name + "\" recompressed by Flash");
121+
}
118122
item.exportToFile(bitmapDir + name);
119123
}
120124
}
@@ -203,7 +207,6 @@ function correctButtonShapeColor(item)
203207
var shape = frame.elements[0];
204208
if (shape.vertices.length == 4 && shape.contours.length == 2) {
205209
var color = shape.contours[1].fill.color;
206-
warn(color);
207210
if (color !== undefined) {
208211
var n = parseInt(color.substring(1), 16);
209212
if (buttonColors[n] === undefined) {

tmpl/js/lwf.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tmpl/js_debug/lwf.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8267,8 +8267,10 @@ if (typeof global === "undefined" && typeof window !== "undefined") {
82678267
this.node = document.createElement("div");
82688268
if (image.src != null) {
82698269
this.node.style.background = "url(" + image.src + ") transparent";
8270-
} else {
8270+
} else if (typeof document.getCSSCanvasContext !== "undefined") {
82718271
this.node.style.background = "-webkit-canvas(" + image.name + ") transparent";
8272+
} else {
8273+
this.node.style.background = "url(" + (image.toDataURL('image/png')) + ") transparent";
82728274
}
82738275
this.node.style.backgroundPosition = "" + (-su) + "px " + (-sv) + "px";
82748276
this.node.style.width = "" + sw + "px";
@@ -8432,6 +8434,7 @@ if (typeof global === "undefined" && typeof window !== "undefined") {
84328434
this.textRendered = false;
84338435
this.textScale = this.lwf.textScale;
84348436
this.currentShadowMarginY = 0;
8437+
this.changed = false;
84358438
this.initCanvas();
84368439
}
84378440

@@ -8704,8 +8707,10 @@ if (typeof global === "undefined" && typeof window !== "undefined") {
87048707
this.initCanvas();
87058708
this.textScale = this.lwf.textScale;
87068709
}
8710+
this.changed = false;
87078711
if (!this.textRendered || colorChanged || fontChanged || strChanged || scaleChanged) {
87088712
this.renderText(c);
8713+
this.changed = true;
87098714
}
87108715
};
87118716

@@ -8855,9 +8860,12 @@ if (typeof global === "undefined" && typeof window !== "undefined") {
88558860
this.context.factory.stage.appendChild(this.node);
88568861
nodeChanged = true;
88578862
}
8858-
if (this.currentCanvas !== this.canvas) {
8863+
if (typeof document.getCSSCanvasContext !== 'undefined' && this.currentCanvas !== this.canvas) {
88598864
this.node.style.background = "-webkit-canvas(" + this.canvas.name + ") transparent";
88608865
this.currentCanvas = this.canvas;
8866+
} else if (this.changed || this.currentCanvas !== this.canvas) {
8867+
this.node.style.background = "url(" + (this.canvas.toDataURL('image/png')) + ") transparent";
8868+
this.currentCanvas = this.canvas;
88618869
}
88628870
maskMode = this.context.factory.maskMode;
88638871
if (!nodeChanged && !this.matrixChanged && this.alpha === c.multi.alpha && this.zIndex === renderingIndex && maskMode === "normal" && this.node.parentNode === this.context.factory.stage) {
@@ -9563,7 +9571,7 @@ if (typeof global === "undefined" && typeof window !== "undefined") {
95639571
WebkitCSSResourceCache.prototype.createCanvas = function(w, h) {
95649572
var canvas, ctx, name;
95659573
name = this.getCanvasName();
9566-
if (this.constructor === WebkitCSSResourceCache) {
9574+
if (typeof document.getCSSCanvasContext !== 'undefined' && this.constructor === WebkitCSSResourceCache) {
95679575
ctx = document.getCSSCanvasContext("2d", name, w, h);
95689576
canvas = ctx.canvas;
95699577
} else {

0 commit comments

Comments
 (0)