diff options
| author | YAMAMOTO Mitsuharu | 2016-04-14 07:47:55 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2016-04-14 07:47:55 +0900 |
| commit | 567ab529f313bc8fe68d25b2ca95f5987cce81a1 (patch) | |
| tree | 4beaa111b3d6a898b6c5468c33cfa9c2fb368843 /src | |
| parent | 24b87a1d4aadbdeafbc0db17e3a760cc9a7e21ef (diff) | |
| download | emacs-567ab529f313bc8fe68d25b2ca95f5987cce81a1.tar.gz emacs-567ab529f313bc8fe68d25b2ca95f5987cce81a1.zip | |
* src/xwidget.c (x_draw_xwidget_glyph_string): More clipping fixes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xwidget.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/xwidget.c b/src/xwidget.c index 7e96307bdd8..82449f7a215 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -580,20 +580,14 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 580 | 580 | ||
| 581 | int text_area_x, text_area_y, text_area_width, text_area_height; | 581 | int text_area_x, text_area_y, text_area_width, text_area_height; |
| 582 | 582 | ||
| 583 | window_box (s->w, | 583 | window_box (s->w, TEXT_AREA, &text_area_x, &text_area_y, |
| 584 | ANY_AREA, | 584 | &text_area_width, &text_area_height); |
| 585 | &text_area_x, | 585 | clip_left = max (0, text_area_x - x); |
| 586 | &text_area_y, | 586 | clip_right = max (clip_left, |
| 587 | &text_area_width, | 587 | min (xww->width, text_area_x + text_area_width - x)); |
| 588 | &text_area_height); | 588 | clip_top = max (0, text_area_y - y); |
| 589 | clip_right = min (xww->width, | 589 | clip_bottom = max (clip_top, |
| 590 | text_area_width); | 590 | min (xww->height, text_area_y + text_area_height - y)); |
| 591 | clip_left = max (0, | ||
| 592 | text_area_x); | ||
| 593 | |||
| 594 | clip_bottom = min (xww->height, | ||
| 595 | text_area_height); | ||
| 596 | clip_top = max (0, text_area_y); | ||
| 597 | 591 | ||
| 598 | /* We are concerned with movement of the onscreen area. The area | 592 | /* We are concerned with movement of the onscreen area. The area |
| 599 | might sit still when the widget actually moves. This happens | 593 | might sit still when the widget actually moves. This happens |
| @@ -622,8 +616,8 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 622 | || xv->clip_bottom != clip_bottom | 616 | || xv->clip_bottom != clip_bottom |
| 623 | || xv->clip_top != clip_top || xv->clip_left != clip_left) | 617 | || xv->clip_top != clip_top || xv->clip_left != clip_left) |
| 624 | { | 618 | { |
| 625 | gtk_widget_set_size_request (xv->widgetwindow, clip_right + clip_left, | 619 | gtk_widget_set_size_request (xv->widgetwindow, clip_right - clip_left, |
| 626 | clip_bottom + clip_top); | 620 | clip_bottom - clip_top); |
| 627 | gtk_fixed_move (GTK_FIXED (xv->widgetwindow), xv->widget, -clip_left, | 621 | gtk_fixed_move (GTK_FIXED (xv->widgetwindow), xv->widget, -clip_left, |
| 628 | -clip_top); | 622 | -clip_top); |
| 629 | 623 | ||