From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46464: 27.1; wide images are hidden partially at the right edge of window Date: Mon, 15 Feb 2021 17:41:15 +0200 Message-ID: <83o8gl9w4k.fsf@gnu.org> References: <86zh09s4m9.fsf@gmail.com> <83wnvcceao.fsf@gnu.org> <86y2fqg1rw.fsf@gmail.com> <83h7mebpgc.fsf@gnu.org> <86pn11fnyv.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30180"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46464@debbugs.gnu.org To: ynyaaa@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 15 16:42:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBg0o-0007iG-FA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Feb 2021 16:42:10 +0100 Original-Received: from localhost ([::1]:48154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBg0n-0002qy-00 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Feb 2021 10:42:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBg0g-0002qi-5J for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 10:42:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBg0f-0002RR-Un for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 10:42:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lBg0f-0003je-Sj for bug-gnu-emacs@gnu.org; Mon, 15 Feb 2021 10:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Feb 2021 15:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46464 X-GNU-PR-Package: emacs Original-Received: via spool by 46464-submit@debbugs.gnu.org id=B46464.161340367714286 (code B ref 46464); Mon, 15 Feb 2021 15:42:01 +0000 Original-Received: (at 46464) by debbugs.gnu.org; 15 Feb 2021 15:41:17 +0000 Original-Received: from localhost ([127.0.0.1]:38535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBfzx-0003iM-94 for submit@debbugs.gnu.org; Mon, 15 Feb 2021 10:41:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBfzv-0003i9-Pt for 46464@debbugs.gnu.org; Mon, 15 Feb 2021 10:41:16 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59460) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBfzq-0001zA-Ht; Mon, 15 Feb 2021 10:41:10 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1765 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lBfzp-0005bC-UN; Mon, 15 Feb 2021 10:41:10 -0500 In-Reply-To: <86pn11fnyv.fsf@gmail.com> (ynyaaa@gmail.com) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:200067 Archived-At: > From: ynyaaa@gmail.com > Cc: 46464@debbugs.gnu.org > Date: Mon, 15 Feb 2021 22:40:56 +0900 > > >> If a edge of a image is near the right edge of the window, > >> the image is mostly hidden. It is not preferable. > > > > That's how Emacs behaved since v21. > > If the width of the iamge is 200 pixels, typing some characters at the > beginning of the same line, the image moves to the right and gets hidden > gradually and is wrapped to the next visual line. > > If the width of the image is 150 pixels, the entire image does not get > hidden and it is wrapped when the image right edge is going to across > the right edge of the window. > > What is the difference? There's a heuristic that changes behavior when the image becomes wider than 1/4 of the window. By default, the "emacs -Q" window is 640 pixels wide, so that's what you see. > >> And if :margin is specified, the image may be hidden completely. > >> > >> By the way, if :margin is specified, a partial image on the right edge > >> of the window is displayed with right margin. > > > > I don't think I understand what you mean by that. Can you show a test > > case? > > Evaluating the form below, four images are supposed to be displayed in > the first visual line. But the fourth image is invisible. Similar for > the second visual line. > > If ':margin 5' is replaced with ':margin 20', three images are displayed > in the first to third visual lines. Third image in each visual line is > truncated at the x-coordinate 20 pixels apart from the right edge of the > window. It looks as if the image is not truncated and is small. > > (dotimes (i 10) > (let* ((w 200) (h 30) (sw 6) > (color (nth (% i 5) '("red" "green" "blue" "yellow" "orange"))) > (svg (format " version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"> > stroke-width=\"%g\" fill=\"grey\"/> > " w h (/ sw 2) (/ sw 2) (- w sw) (- h sw) color sw))) > (insert-image (create-image svg 'svg t :margin 5 :scale 1)))) I will look into this and see if this is a bug or intended behavior. In general, Lisp programs that display wide images should be careful about these aspects to make sure images aren't clipped and appear in their entirety.