Commit 1cc3cf1f authored by rockyl's avatar rockyl

。。。

parent bca64451
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"id":"engine","url_dbg":"engine.1531e1ce239eefdc940cfc3ee5b6e31b7df98fd9.js","url":"engine.min.64c67f3bebea51c4d348989ff6bf86d17531bc85.js"} {"id":"engine","url_dbg":"engine.532693328a5de3160fb3650735e23bb131d62e00.js","url":"engine.min.b80dd14683c0ed27effe3224feae757dc230f462.js"}
\ No newline at end of file \ No newline at end of file
...@@ -12,6 +12,8 @@ const fs = require('fs'); ...@@ -12,6 +12,8 @@ const fs = require('fs');
const tslibWrapper = 'var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: __decorate,__param: __param,__metadata: __metadata,__awaiter: __awaiter,__generator: __generator,__exportStar: __exportStar,__values: __values,__read: __read,__spread: __spread,__spreadArrays: __spreadArrays,__await: __await,__asyncGenerator: __asyncGenerator,__asyncDelegator: __asyncDelegator,__asyncValues: __asyncValues,__makeTemplateObject: __makeTemplateObject,__importStar: __importStar,__importDefault: __importDefault};' const tslibWrapper = 'var tslib = {__extends: __extends,__assign: __assign,__rest: __rest,__decorate: __decorate,__param: __param,__metadata: __metadata,__awaiter: __awaiter,__generator: __generator,__exportStar: __exportStar,__values: __values,__read: __read,__spread: __spread,__spreadArrays: __spreadArrays,__await: __await,__asyncGenerator: __asyncGenerator,__asyncDelegator: __asyncDelegator,__asyncValues: __asyncValues,__makeTemplateObject: __makeTemplateObject,__importStar: __importStar,__importDefault: __importDefault};'
const tslibCode = fs.readFileSync(__dirname + '/scripts/tslib.min.js'); const tslibCode = fs.readFileSync(__dirname + '/scripts/tslib.min.js');
const isProd = process.env.BUILD === 'production';
export default { export default {
input: 'src/index.ts', input: 'src/index.ts',
output: [ output: [
...@@ -30,9 +32,10 @@ export default { ...@@ -30,9 +32,10 @@ export default {
resolve({}), resolve({}),
typescript({ typescript({
// useTsconfigDeclarationDir: true, // useTsconfigDeclarationDir: true,
//target: isProd ? 'ES5' : 'ES2017'
}), }),
commonjs(), commonjs(),
process.env.BUILD === 'production' && uglify({}) isProd && uglify({})
], ],
external: ['tslib'], external: ['tslib'],
}; };
...@@ -106,8 +106,13 @@ function doXhrRequest({url, method, params, type, headers}, resolve, reject) { ...@@ -106,8 +106,13 @@ function doXhrRequest({url, method, params, type, headers}, resolve, reject) {
reject(reason) reject(reason)
}; };
xhr.onloadend = (): void => { xhr.onloadend = (): void => {
if (xhr.status == 404) { switch(xhr.status){
reject(url + ' 404 (Not Found)') case 404:
reject(url + ' 404 (Not Found)')
break;
case 429:
reject(url + ' Bandwidth Limit Exceeded')
break;
} }
}; };
if (isGet) { if (isGet) {
......
...@@ -322,7 +322,7 @@ export class TextField extends Sprite { ...@@ -322,7 +322,7 @@ export class TextField extends Sprite {
let targetItem; let targetItem;
let count = 0; let count = 0;
for (let item of this._textFlow) { for (let item of this._textFlow) {
count += item.text.length; count += item.text.replace(/\n|\r/g,"").length;
if (index < count) { if (index < count) {
targetItem = item; targetItem = item;
break; break;
...@@ -755,7 +755,7 @@ export class TextField extends Sprite { ...@@ -755,7 +755,7 @@ export class TextField extends Sprite {
for (let i = 0, l = hardLines.length; i < l; i++) { for (let i = 0, l = hardLines.length; i < l; i++) {
let str = hardLines[i]; let str = hardLines[i];
if (!str) continue; if (!str) continue;
let w = measureChar(str[0], index++); let w = measureChar(str[0], index);
let lineStr = str[0]; let lineStr = str[0];
let wordW = 0; let wordW = 0;
let strLen = str.length; let strLen = str.length;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment