Skip to content

Commit

Permalink
protect against windows which break the rounded rect
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixKratz committed Nov 16, 2023
1 parent 6d71ea2 commit bbdf178
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LIBS = -framework AppKit -F/System/Library/PrivateFrameworks/ -framework SkyLigh
all: | bin
clang -std=c99 -O3 -g $(FILES) -o bin/borders $(LIBS)

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

bin:
Expand Down
5 changes: 3 additions & 2 deletions src/border.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ void border_draw(struct border* border) {
-g_settings.border_width,
-g_settings.border_width );

if (frame.size.width < 2.f * inner_border_radius
|| frame.size.height < 2.f * inner_border_radius) {
CGRect smallest_rect = CGRectInset(window_frame, 1.0, 1.0);
if (smallest_rect.size.width < 2.f * inner_border_radius
|| smallest_rect.size.height < 2.f * inner_border_radius) {
return;
}

Expand Down

0 comments on commit bbdf178

Please sign in to comment.