Commit 480407eb authored by Karl Heuer's avatar Karl Heuer

* xterm.c (x_new_font): Compute number of scrollbar columns.

parent beded970
......@@ -2607,7 +2607,7 @@ XTset_vertical_scroll_bar (window, portion, whole, position)
/* Where should this scroll bar be, pixelwise? */
int pixel_top = CHAR_TO_PIXEL_ROW (f, top);
int pixel_left = CHAR_TO_PIXEL_COL (f, left);
int pixel_width = VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f);
int pixel_width = FRAME_SCROLL_BAR_PIXEL_WIDTH (f);
int pixel_height = VERTICAL_SCROLL_BAR_PIXEL_HEIGHT (f, height);
struct scroll_bar *bar;
......@@ -4497,8 +4497,12 @@ x_new_font (f, fontname)
/* If we have, just return it from the table. */
if (already_loaded >= 0)
f->display.x->font = x_font_table[already_loaded].font;
{
int wid;
f->display.x->font = x_font_table[already_loaded].font;
wid = FONT_WIDTH (f->display.x->font);
f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid;
}
/* Otherwise, load the font and add it to the table. */
else
{
......@@ -4569,6 +4573,10 @@ x_new_font (f, fontname)
if (full_name)
fontname = full_name;
{
int wid = FONT_WIDTH (f->display.x->font);
f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid;
}
}
/* Now make the frame display the given font. */
......@@ -4718,7 +4726,7 @@ x_set_window_size (f, change_gravity, cols, rows)
check_frame_size (f, &rows, &cols);
f->display.x->vertical_scroll_bar_extra
= (FRAME_HAS_VERTICAL_SCROLL_BARS (f)
? VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f)
? FRAME_SCROLL_BAR_PIXEL_WIDTH (f)
: 0);
pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment