aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
authorJason Rumney2000-10-19 19:21:07 +0000
committerJason Rumney2000-10-19 19:21:07 +0000
commit2d0c0bd755321d6d1815fd6f619a100cdebf5d2e (patch)
treec5a74d19845201d65d202feec45724aff18fe670 /src/w32term.c
parent1660f34ae467529ef06188b74c8b377500a0c53f (diff)
downloademacs-2d0c0bd755321d6d1815fd6f619a100cdebf5d2e.tar.gz
emacs-2d0c0bd755321d6d1815fd6f619a100cdebf5d2e.zip
(x_produce_glyphs): Handle unibyte_display_via_language_environment correctly.
(w32_draw_box_rect): Fix the calculation of width and height.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/w32term.c b/src/w32term.c
index b336fc9fbe5..950d5525d59 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1894,6 +1894,17 @@ x_produce_glyphs (it)
1894 struct font_info *font_info; 1894 struct font_info *font_info;
1895 int boff; /* baseline offset */ 1895 int boff; /* baseline offset */
1896 HDC hdc; 1896 HDC hdc;
1897 /* We may change it->multibyte_p upon unibyte<->multibyte
1898 conversion. So, save the current value now and restore it
1899 later.
1900
1901 Note: It seems that we don't have to record multibyte_p in
1902 struct glyph because the character code itself tells if or
1903 not the character is multibyte. Thus, in the future, we must
1904 consider eliminating the field `multibyte_p' in the struct
1905 glyph.
1906 */
1907 int saved_multibyte_p = it->multibyte_p;
1897 1908
1898 hdc = get_frame_dc (it->f); 1909 hdc = get_frame_dc (it->f);
1899 1910
@@ -1908,6 +1919,7 @@ x_produce_glyphs (it)
1908 || !NILP (Vnonascii_translation_table))) 1919 || !NILP (Vnonascii_translation_table)))
1909 { 1920 {
1910 it->char_to_display = unibyte_char_to_multibyte (it->c); 1921 it->char_to_display = unibyte_char_to_multibyte (it->c);
1922 it->multibyte_p = 1;
1911 it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display); 1923 it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display);
1912 face = FACE_FROM_ID (it->f, it->face_id); 1924 face = FACE_FROM_ID (it->f, it->face_id);
1913 } 1925 }
@@ -1915,6 +1927,7 @@ x_produce_glyphs (it)
1915 && !it->multibyte_p) 1927 && !it->multibyte_p)
1916 { 1928 {
1917 it->char_to_display = multibyte_char_to_unibyte (it->c, Qnil); 1929 it->char_to_display = multibyte_char_to_unibyte (it->c, Qnil);
1930 it->multibyte_p = 0;
1918 it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display); 1931 it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display);
1919 face = FACE_FROM_ID (it->f, it->face_id); 1932 face = FACE_FROM_ID (it->f, it->face_id);
1920 } 1933 }
@@ -2133,6 +2146,7 @@ x_produce_glyphs (it)
2133 xfree (pcm); 2146 xfree (pcm);
2134 } 2147 }
2135 release_frame_dc (it->f, hdc); 2148 release_frame_dc (it->f, hdc);
2149 it->multibyte_p = saved_multibyte_p;
2136 } 2150 }
2137 else if (it->what == IT_COMPOSITION) 2151 else if (it->what == IT_COMPOSITION)
2138 { 2152 {
@@ -3297,24 +3311,24 @@ w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
3297 3311
3298 /* Top. */ 3312 /* Top. */
3299 w32_fill_area (s->f, s->hdc, s->face->box_color, 3313 w32_fill_area (s->f, s->hdc, s->face->box_color,
3300 left_x, top_y, right_x - left_x, width); 3314 left_x, top_y, right_x - left_x + 1, width);
3301 3315
3302 /* Left. */ 3316 /* Left. */
3303 if (left_p) 3317 if (left_p)
3304 { 3318 {
3305 w32_fill_area (s->f, s->hdc, s->face->box_color, 3319 w32_fill_area (s->f, s->hdc, s->face->box_color,
3306 left_x, top_y, width, bottom_y - top_y); 3320 left_x, top_y, width, bottom_y - top_y + 1);
3307 } 3321 }
3308 3322
3309 /* Bottom. */ 3323 /* Bottom. */
3310 w32_fill_area (s->f, s->hdc, s->face->box_color, 3324 w32_fill_area (s->f, s->hdc, s->face->box_color,
3311 left_x, bottom_y - width, right_x - left_x, width); 3325 left_x, bottom_y - width + 1, right_x - left_x + 1, width);
3312 3326
3313 /* Right. */ 3327 /* Right. */
3314 if (right_p) 3328 if (right_p)
3315 { 3329 {
3316 w32_fill_area (s->f, s->hdc, s->face->box_color, 3330 w32_fill_area (s->f, s->hdc, s->face->box_color,
3317 right_x - width, top_y, width, bottom_y - top_y); 3331 right_x - width + 1, top_y, width, bottom_y - top_y + 1);
3318 } 3332 }
3319 3333
3320 w32_set_clip_rectangle (s->hdc, NULL); 3334 w32_set_clip_rectangle (s->hdc, NULL);