Skip to content

Commit

Permalink
fix: bgi判断内容错误 #104
Browse files Browse the repository at this point in the history
  • Loading branch information
army8735 committed Nov 19, 2020
1 parent c659eea commit b3552ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11903,7 +11903,7 @@
this.__innerWidth = w += computedStyle.paddingLeft + computedStyle.paddingRight;
this.__innerHeight = h += computedStyle.paddingTop + computedStyle.paddingBottom;
this.__outerWidth = w + computedStyle.marginLeft + computedStyle.borderLeftWidth + computedStyle.marginRight + computedStyle.borderRightWidth;
this.__outerHeight = h + computedStyle.marginTop + computedStyle.borderTopWidth + computedStyle.marginBottom + computedStyle.borderBottomWidth; // console.log(this.tagName, w, this.__innerWidth);
this.__outerHeight = h + computedStyle.marginTop + computedStyle.borderTopWidth + computedStyle.marginBottom + computedStyle.borderBottomWidth;
} // absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,比如flex列计算时

}, {
Expand Down Expand Up @@ -12309,9 +12309,7 @@
loadBgi.source = cache.source;
loadBgi.width = cache.width;
loadBgi.height = cache.height;
}

if (loadBgi.url !== backgroundImage) {
} else if (loadBgi.url !== backgroundImage) {
// 可能改变导致多次加载,每次清空,成功后还要比对url是否相同
loadBgi.url = backgroundImage;
loadBgi.source = null;
Expand All @@ -12326,6 +12324,8 @@
root.delRefreshTask(loadBgi.cb);
root.addRefreshTask(loadBgi.cb = {
__before: function __before() {
__cacheStyle.backgroundImage = undefined;

root.__addUpdate({
node: node,
focus: o$1.REPAINT
Expand Down Expand Up @@ -12480,7 +12480,7 @@

var _backgroundImage = __cacheStyle.backgroundImage;

if (util.isString(_backgroundImage)) {
if (_backgroundImage) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/node/Xom.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,6 @@ class Xom extends Node {
+ computedStyle.marginRight + computedStyle.borderRightWidth;
this.__outerHeight = h + computedStyle.marginTop + computedStyle.borderTopWidth
+ computedStyle.marginBottom + computedStyle.borderBottomWidth;
// console.log(this.tagName, w, this.__innerWidth);
}

// absolute且无尺寸时,isVirtual标明先假布局一次计算尺寸,比如flex列计算时
Expand Down Expand Up @@ -1105,7 +1104,7 @@ class Xom extends Node {
loadBgi.width = cache.width;
loadBgi.height = cache.height;
}
if(loadBgi.url !== backgroundImage) {
else if(loadBgi.url !== backgroundImage) {
// 可能改变导致多次加载,每次清空,成功后还要比对url是否相同
loadBgi.url = backgroundImage;
loadBgi.source = null;
Expand All @@ -1120,6 +1119,7 @@ class Xom extends Node {
root.delRefreshTask(loadBgi.cb);
root.addRefreshTask(loadBgi.cb = {
__before() {
__cacheStyle.backgroundImage = undefined;
root.__addUpdate({
node,
focus: level.REPAINT,
Expand Down Expand Up @@ -1296,7 +1296,7 @@ class Xom extends Node {
return this.__hasContent;
}
let backgroundImage = __cacheStyle.backgroundImage;
if(util.isString(backgroundImage)) {
if(backgroundImage) {
return true;
}
if(computedStyle.backgroundColor[3] > 0) {
Expand Down

0 comments on commit b3552ad

Please sign in to comment.