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.
This commit is contained in:
Po Lu 2021-11-24 09:38:26 +00:00
parent d112c75f53
commit 3219518e5c
2 changed files with 4 additions and 4 deletions

View file

@ -664,8 +664,8 @@ class EmacsWindow : public BDirectWindow
{
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);

View file

@ -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);