diff options
| author | Karl Heuer | 1994-09-20 05:05:02 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-09-20 05:05:02 +0000 |
| commit | 480407eb720feca072c99128117ffa80fd46a9ba (patch) | |
| tree | bbeb973ce07cf9cf359e10419ebc22e4cce53ec0 /src | |
| parent | beded970ac9427cce7b7c2170c57b71f90d833ab (diff) | |
| download | emacs-480407eb720feca072c99128117ffa80fd46a9ba.tar.gz emacs-480407eb720feca072c99128117ffa80fd46a9ba.zip | |
* xterm.c (x_new_font): Compute number of scrollbar columns.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 16 |
1 files changed, 12 insertions, 4 deletions
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) | |||
| 2607 | /* Where should this scroll bar be, pixelwise? */ | 2607 | /* Where should this scroll bar be, pixelwise? */ |
| 2608 | int pixel_top = CHAR_TO_PIXEL_ROW (f, top); | 2608 | int pixel_top = CHAR_TO_PIXEL_ROW (f, top); |
| 2609 | int pixel_left = CHAR_TO_PIXEL_COL (f, left); | 2609 | int pixel_left = CHAR_TO_PIXEL_COL (f, left); |
| 2610 | int pixel_width = VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f); | 2610 | int pixel_width = FRAME_SCROLL_BAR_PIXEL_WIDTH (f); |
| 2611 | int pixel_height = VERTICAL_SCROLL_BAR_PIXEL_HEIGHT (f, height); | 2611 | int pixel_height = VERTICAL_SCROLL_BAR_PIXEL_HEIGHT (f, height); |
| 2612 | 2612 | ||
| 2613 | struct scroll_bar *bar; | 2613 | struct scroll_bar *bar; |
| @@ -4497,8 +4497,12 @@ x_new_font (f, fontname) | |||
| 4497 | 4497 | ||
| 4498 | /* If we have, just return it from the table. */ | 4498 | /* If we have, just return it from the table. */ |
| 4499 | if (already_loaded >= 0) | 4499 | if (already_loaded >= 0) |
| 4500 | f->display.x->font = x_font_table[already_loaded].font; | 4500 | { |
| 4501 | 4501 | int wid; | |
| 4502 | f->display.x->font = x_font_table[already_loaded].font; | ||
| 4503 | wid = FONT_WIDTH (f->display.x->font); | ||
| 4504 | f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid; | ||
| 4505 | } | ||
| 4502 | /* Otherwise, load the font and add it to the table. */ | 4506 | /* Otherwise, load the font and add it to the table. */ |
| 4503 | else | 4507 | else |
| 4504 | { | 4508 | { |
| @@ -4569,6 +4573,10 @@ x_new_font (f, fontname) | |||
| 4569 | 4573 | ||
| 4570 | if (full_name) | 4574 | if (full_name) |
| 4571 | fontname = full_name; | 4575 | fontname = full_name; |
| 4576 | { | ||
| 4577 | int wid = FONT_WIDTH (f->display.x->font); | ||
| 4578 | f->scroll_bar_cols = (f->scroll_bar_pixel_width + wid-1) / wid; | ||
| 4579 | } | ||
| 4572 | } | 4580 | } |
| 4573 | 4581 | ||
| 4574 | /* Now make the frame display the given font. */ | 4582 | /* Now make the frame display the given font. */ |
| @@ -4718,7 +4726,7 @@ x_set_window_size (f, change_gravity, cols, rows) | |||
| 4718 | check_frame_size (f, &rows, &cols); | 4726 | check_frame_size (f, &rows, &cols); |
| 4719 | f->display.x->vertical_scroll_bar_extra | 4727 | f->display.x->vertical_scroll_bar_extra |
| 4720 | = (FRAME_HAS_VERTICAL_SCROLL_BARS (f) | 4728 | = (FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
| 4721 | ? VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f) | 4729 | ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) |
| 4722 | : 0); | 4730 | : 0); |
| 4723 | pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); | 4731 | pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); |
| 4724 | pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); | 4732 | pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |