Skip to content

Commit

Permalink
more strict Box.hasBackground (consider alpha)
Browse files Browse the repository at this point in the history
not sure how common, but this surprised me when I was logging
stuff/working on something else
  • Loading branch information
chearon committed Dec 30, 2024
1 parent 57d1cbe commit 102b09e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/layout-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1018,10 +1018,10 @@ export class BlockContainer extends Box {

hasBackground() {
return this.style.backgroundColor.a > 0
|| this.style.borderTopWidth > 0
|| this.style.borderRightWidth > 0
|| this.style.borderBottomWidth > 0
|| this.style.borderLeftWidth > 0;
|| this.style.borderTopWidth > 0 && this.style.borderTopColor.a > 0
|| this.style.borderRightWidth > 0 && this.style.borderRightColor.a > 0
|| this.style.borderBottomWidth > 0 && this.style.borderBottomColor.a > 0
|| this.style.borderLeftWidth > 0 && this.style.borderLeftColor.a > 0;
}

hasForeground() {
Expand Down

0 comments on commit 102b09e

Please sign in to comment.