Mercurial > emacs
changeset 8941:71762e6d69e0
* xterm.c (x_new_font): Compute number of scrollbar columns.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 20 Sep 1994 05:05:02 +0000 |
parents | 18b0314420d5 |
children | a43f3b56ed47 |
files | src/xterm.c |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xterm.c Tue Sep 20 04:47:17 1994 +0000 +++ b/src/xterm.c Tue Sep 20 05:05:02 1994 +0000 @@ -2607,7 +2607,7 @@ /* 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 @@ /* 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 @@ 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 @@ 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);