window: do not attempt to fill offscreen windows
This commit is contained in:
parent
4f5db2b224
commit
329ba0e43b
1 changed files with 4 additions and 0 deletions
|
@ -213,6 +213,10 @@ pub fn gwidth(self: Window, str: []const u8) usize {
|
||||||
|
|
||||||
/// fills the window with the provided cell
|
/// fills the window with the provided cell
|
||||||
pub fn fill(self: Window, cell: Cell) void {
|
pub fn fill(self: Window, cell: Cell) void {
|
||||||
|
if (self.screen.width < self.x_off)
|
||||||
|
return;
|
||||||
|
if (self.screen.height < self.y_off)
|
||||||
|
return;
|
||||||
if (self.x_off == 0 and self.width == self.screen.width) {
|
if (self.x_off == 0 and self.width == self.screen.width) {
|
||||||
// we have a full width window, therefore contiguous memory.
|
// we have a full width window, therefore contiguous memory.
|
||||||
const start = self.y_off * self.width;
|
const start = self.y_off * self.width;
|
||||||
|
|
Loading…
Reference in a new issue