Proper fix for not drawing blank rects when bg image is present

This commit is contained in:
Kovid Goyal
2020-02-02 20:20:45 +05:30
parent 5b4e0ed483
commit 75c47a8659
2 changed files with 17 additions and 4 deletions

View File

@@ -5,7 +5,8 @@
from itertools import chain
from .fast_data_types import (
BORDERS_PROGRAM, add_borders_rect, compile_program, init_borders_program
BORDERS_PROGRAM, add_borders_rect, compile_program, init_borders_program,
os_window_has_background_image
)
from .utils import load_shaders
@@ -63,8 +64,10 @@ class Borders:
draw_window_borders=True,
):
add_borders_rect(self.os_window_id, self.tab_id, 0, 0, 0, 0, BorderColor.default_bg)
for br in chain(current_layout.blank_rects, extra_blank_rects):
add_borders_rect(self.os_window_id, self.tab_id, *br, BorderColor.default_bg)
has_background_image = os_window_has_background_image(self.os_window_id)
if not has_background_image:
for br in chain(current_layout.blank_rects, extra_blank_rects):
add_borders_rect(self.os_window_id, self.tab_id, *br, BorderColor.default_bg)
bw, pw = self.border_width, self.padding_width
if bw + pw <= 0:
return
@@ -85,7 +88,7 @@ class Borders:
colors = tuple(color if needed else window_bg for needed in next(border_data))
draw_edges(
self.os_window_id, self.tab_id, colors, bw, g, base_width=pw)
if pw > 0:
if pw > 0 and not has_background_image:
# Draw the background rectangles over the padding region
colors = (window_bg, window_bg, window_bg, window_bg)
draw_edges(