view: use saved geometry for borders if needed

This fixes the issues caused by 60f06a1 and greatly simplifies the code.
Turns out we were already tracking the dimensions needed.
This commit is contained in:
Isaac Freund
2020-06-28 20:45:17 +02:00
parent 5b96d831d3
commit 82a444a7c0
5 changed files with 3 additions and 34 deletions

View File

@ -240,10 +240,11 @@ fn renderTexture(
fn renderBorders(output: Output, view: *View, now: *c.timespec) void {
const config = &output.root.server.config;
var border: Box = undefined;
const color = if (view.focused) &config.border_color_focused else &config.border_color_unfocused;
const border_width = config.border_width;
const actual_box = view.getActualBox();
const actual_box = if (view.saved_buffers.items.len != 0) view.saved_surface_box else view.surface_box;
var border: Box = undefined;
// left and right, covering the corners as well
border.y = view.current.box.y - @intCast(i32, border_width);