From 3219518e5c64281237bb604e6c2977f655aff238 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 24 Nov 2021 09:38:26 +0000 Subject: [PATCH] Fix 1 pixel wide border in frames on Haiku * src/haiku_support.cc (EmacsWindow.FrameResized): Add 1 to pixel widths. * src/haikuterm.c (haiku_read_socket): Use `lrint' to round widths. --- src/haiku_support.cc | 4 ++-- src/haikuterm.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 5f9fe7e234f..9fb98f70814 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -664,8 +664,8 @@ public: { struct haiku_resize_event rq; rq.window = this; - rq.px_heightf = newHeight; - rq.px_widthf = newWidth; + rq.px_heightf = newHeight + 1.0f; + rq.px_widthf = newWidth + 1.0f; haiku_write (FRAME_RESIZED, &rq); BDirectWindow::FrameResized (newWidth, newHeight); diff --git a/src/haikuterm.c b/src/haikuterm.c index be2b6c2491f..3e5b6046f6d 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -2626,8 +2626,8 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) if (!f) continue; - int width = (int) b->px_widthf; - int height = (int) b->px_heightf; + int width = lrint (b->px_widthf); + int height = lrint (b->px_heightf); BView_draw_lock (FRAME_HAIKU_VIEW (f)); BView_resize_to (FRAME_HAIKU_VIEW (f), width, height); -- 2.39.2