Skip to content

Commit

Permalink
fix: innerShadow
Browse files Browse the repository at this point in the history
  • Loading branch information
army8735 committed Mar 29, 2024
1 parent 8b1f240 commit 4ff6980
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 56 deletions.
58 changes: 3 additions & 55 deletions src/node/Bitmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,56 +84,9 @@ class Bitmap extends Node {
this.loader.error = true;
}
}
// if (!cache) {
// inject.measureImg(src, (res: any) => {
// // 可能会变更,所以加载完后对比下是不是当前最新的
// if (src === this._src) {
// if (res.success) {
// if (isFunction(props.onLoad)) {
// props.onLoad!();
// }
// } else {
// if (isFunction(props.onError)) {
// props.onError!();
// }
// }
// }
// });
// } else if (cache.state === inject.LOADED) {
// if (cache.success) {
// this.loader.source = cache.source;
// this.loader.width = cache.source.width;
// this.loader.height = cache.source.height;
// } else {
// this.loader.error = true;
// }
// }
}
}

// override lay(data: LayoutData) {
// super.lay(data);
// const src = this._src;
// const loader = this.loader;
// if (src) {
// const cache = inject.IMG[src];
// if (!cache || cache.state === inject.LOADING) {
// if (!loader.loading) {
// this.loadAndRefresh();
// }
// } else if (cache && cache.state === inject.LOADED) {
// loader.loading = false;
// if (cache.success) {
// this.loader.source = cache.source;
// this.loader.width = cache.width;
// this.loader.height = cache.height;
// } else {
// this.loader.error = true;
// }
// }
// }
// }

loadAndRefresh() {
// 加载前先清空之前可能遗留的老数据
const loader = this.loader;
Expand Down Expand Up @@ -223,7 +176,6 @@ class Bitmap extends Node {
checkLoader() {
const loader = this.loader;
if (!loader.loading && !loader.source && !loader.error) {
// this.loadAndRefresh();
return true;
}
return false;
Expand Down Expand Up @@ -267,10 +219,6 @@ class Bitmap extends Node {
}
}
return (this.hasContent = !!this.loader.source);
// if (!res && !this.loader.error) {
// this.root!.imgLoadingCount++;
// }
// return res;
}

override renderCanvas(scale: number) {
Expand Down Expand Up @@ -347,9 +295,9 @@ class Bitmap extends Node {
}
const points = [
[0, 0],
[iw / scale, 0],
[iw / scale, ih / scale],
[0, ih / scale],
[iw, 0],
[iw, ih],
[0, ih],
[0, 0],
];
ctx.beginPath();
Expand Down
3 changes: 2 additions & 1 deletion test/group1/render-img/test.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions test/group1/render-shadow/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
browser
.url('file://' + path.join(__dirname, 'index.html'))
.waitForElementVisible('body', 1000)
.pause(20)
.assert.value('input', '')
.end();
}
Expand Down
1 change: 1 addition & 0 deletions test/group1/render-shape/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
browser
.url('file://' + path.join(__dirname, 'index.html'))
.waitForElementVisible('body', 1000)
.pause(20)
.assert.value('input', '')
.end();
}
Expand Down
1 change: 1 addition & 0 deletions test/group1/render-text/test.js

Large diffs are not rendered by default.

0 comments on commit 4ff6980

Please sign in to comment.