this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

window: fix lower bounds for children window

The lower bound must be within the parent window

+6 -4
+6 -4
src/Window.zig
··· 36 36 maybe_width: ?u16, 37 37 maybe_height: ?u16, 38 38 ) Window { 39 - const width: u16 = maybe_width orelse @max(self.width - x_off, 0); 40 - const height: u16 = maybe_height orelse @max(self.height - y_off, 0); 39 + const max_height = @max(self.height - y_off, 0); 40 + const max_width = @max(self.width - x_off, 0); 41 + const width: u16 = maybe_width orelse max_width; 42 + const height: u16 = maybe_height orelse max_height; 41 43 42 44 return Window{ 43 45 .x_off = x_off + self.x_off, 44 46 .y_off = y_off + self.y_off, 45 47 .parent_x_off = @min(self.parent_x_off + x_off, 0), 46 48 .parent_y_off = @min(self.parent_y_off + y_off, 0), 47 - .width = width, 48 - .height = height, 49 + .width = @min(width, max_width), 50 + .height = @min(height, max_height), 49 51 .screen = self.screen, 50 52 }; 51 53 }