all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: joakim@verona.se
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: About x_draw_xwidget_glyph_string
Date: Sun, 10 Apr 2016 17:29:26 +0900	[thread overview]
Message-ID: <wl7fg5vpcp.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <m3shyv9gc3.fsf@exodia.verona.se>

>>>>> On Sat, 09 Apr 2016 13:22:52 +0200, joakim@verona.se said:

>> I think clip_top should use text_area_y and clip_bottom should use
>> text_area_height.
>> 
>> Other than those two issues, what other problems do you see?

> Well, I saw nothing at all :)

> This patch seems to work during some brief testing.

C-x 2 or C-x 3 makes the display incorrect.

I'm not sure if I understand the intended meaning of clip_* variables
correctly, but shouldn't this part be something like below?

			     YAMAMOTO Mitsuharu
			mituharu@math.s.chiba-u.ac.jp

diff --git a/src/xwidget.c b/src/xwidget.c
index 7e96307..0777777 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -580,20 +580,14 @@ x_draw_xwidget_glyph_string (struct glyph_string *s)
 
   int text_area_x, text_area_y, text_area_width, text_area_height;
 
-  window_box (s->w,
-              ANY_AREA,
-              &text_area_x,
-              &text_area_y,
-              &text_area_width,
-              &text_area_height);
-  clip_right = min (xww->width,
-                    text_area_width);
-  clip_left = max (0,
-                   text_area_x);
-
-  clip_bottom = min (xww->height,
-                     text_area_height);
-  clip_top = max (0, text_area_y);
+  window_box (s->w, TEXT_AREA, &text_area_x, &text_area_y,
+              &text_area_width, &text_area_height);
+  clip_left = max (0, text_area_x - x);
+  clip_right = max (clip_left,
+		    min (xww->width, text_area_x + text_area_width - x));
+  clip_top = max (0, text_area_y - y);
+  clip_bottom = max (clip_top,
+		     min (xww->height, text_area_y + text_area_height - y));
 
   /* We are concerned with movement of the onscreen area.  The area
      might sit still when the widget actually moves.  This happens
@@ -622,8 +616,7 @@ x_draw_xwidget_glyph_string (struct glyph_string *s)
       || xv->clip_bottom != clip_bottom
       || xv->clip_top != clip_top || xv->clip_left != clip_left)
     {
-      gtk_widget_set_size_request (xv->widgetwindow, clip_right + clip_left,
-                                   clip_bottom + clip_top);
+      gtk_widget_set_size_request (xv->widgetwindow, clip_right, clip_bottom);
       gtk_fixed_move (GTK_FIXED (xv->widgetwindow), xv->widget, -clip_left,
                       -clip_top);
 



  parent reply	other threads:[~2016-04-10  8:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25  2:07 About x_draw_xwidget_glyph_string YAMAMOTO Mitsuharu
2016-01-25  6:59 ` joakim
2016-01-25 15:46 ` Eli Zaretskii
2016-04-08 15:35   ` joakim
2016-04-09  7:38     ` Eli Zaretskii
2016-04-09 11:22       ` joakim
2016-04-09 12:06         ` Eli Zaretskii
2016-04-10  8:29         ` YAMAMOTO Mitsuharu [this message]
2016-04-11  0:04           ` YAMAMOTO Mitsuharu
2016-04-12 20:46             ` joakim
2016-04-12 21:13             ` joakim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wl7fg5vpcp.wl%mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.