From: joakim@verona.se
To: Eli Zaretskii <eliz@gnu.org>
Cc: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>, emacs-devel@gnu.org
Subject: Re: About x_draw_xwidget_glyph_string
Date: Fri, 08 Apr 2016 17:35:23 +0200 [thread overview]
Message-ID: <m38u0oazb8.fsf@exodia.verona.se> (raw)
In-Reply-To: <83oac93bnr.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 25 Jan 2016 17:46:00 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Mon, 25 Jan 2016 11:07:16 +0900
>> From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
>>
>> 2. Comment on clipping.
>>
>> 578 /* Calculate clipping, which is used for all manner of onscreen
>> 579 xwidget views. Each widget border can get clipped by other emacs
>> 580 objects so there are four clipping variables. */
>> 581 clip_right =
>> 582 min (xww->width,
>> 583 WINDOW_RIGHT_EDGE_X (s->w) - x -
>> 584 WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w) -
>> 585 WINDOW_RIGHT_FRINGE_WIDTH (s->w));
>> 586 clip_left =
>> 587 max (0,
>> 588 WINDOW_LEFT_EDGE_X (s->w) - x +
>> 589 WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (s->w) +
>> 590 WINDOW_LEFT_FRINGE_WIDTH (s->w));
>> 591
>> 592 clip_bottom =
>> 593 min (xww->height,
>> 594 WINDOW_BOTTOM_EDGE_Y (s->w) - WINDOW_MODE_LINE_HEIGHT (s->w) - y);
>> 595 clip_top = max (0, WINDOW_TOP_EDGE_Y (s->w) - y);
>>
>> I think the calculation of clipping should use the function window_box
>> rather than manual calculation with various window macros. Otherwise,
>> xwidget views will cover horizontal scroll bars, for example.
>
> I agree.
>
> Thanks.
>
I tried to do this, but I'm doing something wrong. How is window_box
meant to be used?
This is my attempt to replace the code above:
//JAVE work in progressing, suggested by YAMAMOTO Mitsuharu
int text_area_x, text_area_y, text_area_width, text_area_height;
window_box (s->w,
ANY_AREA, //also tried TEXT_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_y);
clip_top = max (0, text_area_height);
--
Joakim Verona
next prev parent reply other threads:[~2016-04-08 15:35 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 [this message]
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
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m38u0oazb8.fsf@exodia.verona.se \
--to=joakim@verona.se \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=mituharu@math.s.chiba-u.ac.jp \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).