Skip to content

Commit bbdf178

Browse files
committed
protect against windows which break the rounded rect
1 parent 6d71ea2 commit bbdf178

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LIBS = -framework AppKit -F/System/Library/PrivateFrameworks/ -framework SkyLigh
44
all: | bin
55
clang -std=c99 -O3 -g $(FILES) -o bin/borders $(LIBS)
66

7-
debug:
7+
debug: | bin
88
clang -std=c99 -O0 -g -DDEBUG $(FILES) -o bin/debug $(LIBS)
99

1010
bin:

src/border.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ void border_draw(struct border* border) {
5050
-g_settings.border_width,
5151
-g_settings.border_width );
5252

53-
if (frame.size.width < 2.f * inner_border_radius
54-
|| frame.size.height < 2.f * inner_border_radius) {
53+
CGRect smallest_rect = CGRectInset(window_frame, 1.0, 1.0);
54+
if (smallest_rect.size.width < 2.f * inner_border_radius
55+
|| smallest_rect.size.height < 2.f * inner_border_radius) {
5556
return;
5657
}
5758

0 commit comments

Comments
 (0)