aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Third2016-06-18 00:02:32 +0100
committerAlan Third2016-06-26 01:11:22 +0100
commitf7df85a8d103e49cdfe1e510a7ad9f03dc1f9ee5 (patch)
tree993b7c21c1fde7bed9bf866df437d95252856017 /src
parentfdcf46d33eebc59e56a35fcea186c61aad3c81d0 (diff)
downloademacs-f7df85a8d103e49cdfe1e510a7ad9f03dc1f9ee5.tar.gz
emacs-f7df85a8d103e49cdfe1e510a7ad9f03dc1f9ee5.zip
Move text line right when in box (bug#23755)
* src/nsterm.m (ns_draw_glyph_string_foreground): Create to take CHAR_GLYPH specific code and move glyphs right if within a box. (ns_draw_glyph_string): Move CHAR_GLYPH specific code into above function.
Diffstat (limited to 'src')
-rw-r--r--src/nsterm.m38
1 files changed, 28 insertions, 10 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index f2b0d901770..eba75f1b93f 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3640,6 +3640,32 @@ ns_dumpglyphs_stretch (struct glyph_string *s)
3640 3640
3641 3641
3642static void 3642static void
3643ns_draw_glyph_string_foreground (struct glyph_string *s)
3644{
3645 int x, flags;
3646 struct font *font = s->font;
3647
3648 /* If first glyph of S has a left box line, start drawing the text
3649 of S to the right of that box line. */
3650 if (s->face && s->face->box != FACE_NO_BOX
3651 && s->first_glyph->left_box_line_p)
3652 x = s->x + eabs (s->face->box_line_width);
3653 else
3654 x = s->x;
3655
3656 flags = s->hl == DRAW_CURSOR ? NS_DUMPGLYPH_CURSOR :
3657 (s->hl == DRAW_MOUSE_FACE ? NS_DUMPGLYPH_MOUSEFACE :
3658 (s->for_overlaps ? NS_DUMPGLYPH_FOREGROUND :
3659 NS_DUMPGLYPH_NORMAL));
3660
3661 font->driver->draw
3662 (s, s->cmp_from, s->nchars, x, s->ybase,
3663 (flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p)
3664 || flags == NS_DUMPGLYPH_MOUSEFACE);
3665}
3666
3667
3668static void
3643ns_draw_composite_glyph_string_foreground (struct glyph_string *s) 3669ns_draw_composite_glyph_string_foreground (struct glyph_string *s)
3644{ 3670{
3645 int i, j, x; 3671 int i, j, x;
@@ -3737,7 +3763,7 @@ ns_draw_glyph_string (struct glyph_string *s)
3737{ 3763{
3738 /* TODO (optimize): focus for box and contents draw */ 3764 /* TODO (optimize): focus for box and contents draw */
3739 NSRect r[2]; 3765 NSRect r[2];
3740 int n, flags; 3766 int n;
3741 char box_drawn_p = 0; 3767 char box_drawn_p = 0;
3742 struct font *font = s->face->font; 3768 struct font *font = s->face->font;
3743 if (! font) font = FRAME_FONT (s->f); 3769 if (! font) font = FRAME_FONT (s->f);
@@ -3807,11 +3833,6 @@ ns_draw_glyph_string (struct glyph_string *s)
3807 ns_maybe_dumpglyphs_background 3833 ns_maybe_dumpglyphs_background
3808 (s, s->first_glyph->type == COMPOSITE_GLYPH); 3834 (s, s->first_glyph->type == COMPOSITE_GLYPH);
3809 3835
3810 flags = s->hl == DRAW_CURSOR ? NS_DUMPGLYPH_CURSOR :
3811 (s->hl == DRAW_MOUSE_FACE ? NS_DUMPGLYPH_MOUSEFACE :
3812 (s->for_overlaps ? NS_DUMPGLYPH_FOREGROUND :
3813 NS_DUMPGLYPH_NORMAL));
3814
3815 if (s->hl == DRAW_CURSOR && s->w->phys_cursor_type == FILLED_BOX_CURSOR) 3836 if (s->hl == DRAW_CURSOR && s->w->phys_cursor_type == FILLED_BOX_CURSOR)
3816 { 3837 {
3817 unsigned long tmp = NS_FACE_BACKGROUND (s->face); 3838 unsigned long tmp = NS_FACE_BACKGROUND (s->face);
@@ -3825,10 +3846,7 @@ ns_draw_glyph_string (struct glyph_string *s)
3825 if (isComposite) 3846 if (isComposite)
3826 ns_draw_composite_glyph_string_foreground (s); 3847 ns_draw_composite_glyph_string_foreground (s);
3827 else 3848 else
3828 font->driver->draw 3849 ns_draw_glyph_string_foreground (s);
3829 (s, s->cmp_from, s->nchars, s->x, s->ybase,
3830 (flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p)
3831 || flags == NS_DUMPGLYPH_MOUSEFACE);
3832 } 3850 }
3833 3851
3834 { 3852 {