Skip to content

Commit a35d48a

Browse files
committed
perf: optimize scrollbar background for alpha
1 parent 260069d commit a35d48a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/textual/scrollbar.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,9 @@ def render(self) -> RenderableType:
286286
else:
287287
background = styles.scrollbar_background
288288
color = styles.scrollbar_color
289-
base_background, _ = self.parent._opacity_background_colors
290-
background = base_background + background
289+
if background.a > 0:
290+
base_background, _ = self.parent._opacity_background_colors
291+
background = base_background + background
291292
color = background + color
292293
scrollbar_style = Style.from_color(color.rich_color, background.rich_color)
293294
if self.screen.styles.scrollbar_color.a == 0:

0 commit comments

Comments
 (0)