From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: About x_draw_xwidget_glyph_string Date: Sat, 09 Apr 2016 10:38:28 +0300 Message-ID: <83shyvi64r.fsf@gnu.org> References: <83oac93bnr.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1460187560 4737 80.91.229.3 (9 Apr 2016 07:39:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Apr 2016 07:39:20 +0000 (UTC) Cc: mituharu@math.s.chiba-u.ac.jp, emacs-devel@gnu.org To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 09 09:39:19 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aonUD-0006GD-5M for ged-emacs-devel@m.gmane.org; Sat, 09 Apr 2016 09:39:17 +0200 Original-Received: from localhost ([::1]:59502 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aonUC-0005OT-1L for ged-emacs-devel@m.gmane.org; Sat, 09 Apr 2016 03:39:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aonU6-0005Lv-DJ for emacs-devel@gnu.org; Sat, 09 Apr 2016 03:39:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aonU3-0004el-66 for emacs-devel@gnu.org; Sat, 09 Apr 2016 03:39:10 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aonU3-0004eh-2h; Sat, 09 Apr 2016 03:39:07 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1124 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aonU2-0002Mv-5t; Sat, 09 Apr 2016 03:39:06 -0400 In-reply-to: (joakim@verona.se) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:202824 Archived-At: > From: joakim@verona.se > Cc: YAMAMOTO Mitsuharu , emacs-devel@gnu.org > Date: Fri, 08 Apr 2016 17:35:23 +0200 > > Eli Zaretskii writes: > > >> Date: Mon, 25 Jan 2016 11:07:16 +0900 > >> From: YAMAMOTO Mitsuharu > >> > >> 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 You should use TEXT_AREA here. > &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); 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?