From 55ae3fe2ddfb0e0bfa0a0ff84efa17125af62fc0 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Tue, 13 Feb 2024 14:05:23 +0100 Subject: [PATCH] display ack image at the end of the line, not at the front --- node.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/node.lua b/node.lua index 2e3941e..2d70579 100644 --- a/node.lua +++ b/node.lua @@ -95,20 +95,22 @@ function node.render() y = y + margin local service_x = real_width - margin - CONFIG.header_font:width(serv.service, service_font_size) - local host_x = margin if serv.ack then - ack_image:draw(host_x, y, host_x + host_font_size, y + host_font_size) - host_x = host_x + host_font_size + margin + ack_image:draw( + real_width - margin - service_font_size, y, + real_width - margin, y + service_font_size + ) + service_x = service_x - service_font_size - margin end if host_width + service_width > header_width then - CONFIG.header_font:write(host_x, y, serv.host, host_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][2],1) + CONFIG.header_font:write(margin, y, serv.host, host_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][2],1) y = y + host_font_size + margin CONFIG.header_font:write(service_x, y, serv.service, service_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][3],1) y = y + service_font_size + margin else - CONFIG.header_font:write(host_x, y, serv.host, host_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][2],1) + CONFIG.header_font:write(margin, y, serv.host, host_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][2],1) CONFIG.header_font:write(service_x, y, serv.service, service_font_size, c_text[serv.state][1],c_text[serv.state][2],c_text[serv.state][3],1) y = y + CONFIG.header_size + margin end