From: Karl Heuer Date: Tue, 20 Sep 1994 05:05:02 +0000 (+0000) Subject: * xterm.c (x_new_font): Compute number of scrollbar columns. X-Git-Tag: emacs-19.34~6913 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=480407eb720feca072c99128117ffa80fd46a9ba;p=emacs.git * xterm.c (x_new_font): Compute number of scrollbar columns. --- diff --git a/src/xterm.c b/src/xterm.c index c3f863a280a..bd2ffc3444c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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);