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#54688: 29.0.50; Sliced image in margin looks bad Date: Sun, 03 Apr 2022 11:57:04 +0300 Message-ID: <83zgl235pb.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18193"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54688@debbugs.gnu.org To: dalanicolai Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 03 10:58:12 2022 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 1naw3n-0004Uc-92 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Apr 2022 10:58:11 +0200 Original-Received: from localhost ([::1]:60532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naw3l-0008Fa-PX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Apr 2022 04:58:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:32868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naw3e-0008FC-TS for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2022 04:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53685) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naw3e-0002No-KO for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2022 04:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1naw3e-0001ja-Hl for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2022 04:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Apr 2022 08:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54688 X-GNU-PR-Package: emacs Original-Received: via spool by 54688-submit@debbugs.gnu.org id=B54688.16489762336598 (code B ref 54688); Sun, 03 Apr 2022 08:58:02 +0000 Original-Received: (at 54688) by debbugs.gnu.org; 3 Apr 2022 08:57:13 +0000 Original-Received: from localhost ([127.0.0.1]:47576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naw2r-0001iK-Ba for submit@debbugs.gnu.org; Sun, 03 Apr 2022 04:57:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naw2p-0001i7-IR for 54688@debbugs.gnu.org; Sun, 03 Apr 2022 04:57:12 -0400 Original-Received: from [2001:470:142:3::e] (port=33534 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naw2k-0002KW-41; Sun, 03 Apr 2022 04:57:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=posgE5hriK4D5l+USLHsXuQZKvRxSgpoBl9AKdWrJRU=; b=GOoHifArm4J6 z0SYnIBjHX+aB7qmNHN6LaQbZPo0CuaMCQGQgKLLeDC0E3IoxTXmFzpFZyojmL9K1t7C7JB/g8VR1 IFiSPvs8ZTnZHXdiKomtRPVnpRqD+N64T/AKiE5gxb8WpEAIwgsmPFKu2O9hjc5InjDkTA6Rs5ZZi xcEc4BQXMB/6Ew3xtc7ScKZBvcTAdETJnzxxLR2B1Ads97RTOtVy3IXHQNl3KZF8q1Vg+YDJgC+xR tlc+wFi6/XqjcFsXaSVDfKpi5T4ZGVGPHJK2Dss+VOrjR8mnXxB5sjzJy+XyT58/CZgn2N6qLbswb bNQ0MNiFGxTd/0YHSDOo3A==; Original-Received: from [87.69.77.57] (port=1563 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naw2j-0004Js-Kl; Sun, 03 Apr 2022 04:57:05 -0400 In-Reply-To: (message from dalanicolai on Sun, 3 Apr 2022 08:50:20 +0200) 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:229320 Archived-At: > From: dalanicolai > Date: Sun, 3 Apr 2022 08:50:20 +0200 > > Passing 'left-margin' for the AREA parameter in `insert-sliced-image` > results in bad looking image. To reproduce from `emacs -q` evaluate the > following code example: > > (with-current-buffer (get-buffer-create "test") > (setq left-margin-width 5) > (insert-sliced-image (svg-image (let* ((ph (line-pixel-height)) > (size (* 2 ph)) > (svg (svg-create size size))) > (svg-circle svg ph ph ph :fill "red") > svg)) > nil > 'left-margin > 2) > (switch-to-buffer (current-buffer))) > > when instead of 'left-margin', nil is passed as value (i.e. the text is > inserted in the text area), then everything looks fine. "Everything looks fine" until you insert some text after the 2 slices of the image. That is, after evaluating the form with left-margin replaced by nil, do this: C-u 2 M-g c ;; go to buffer position 2 x ;; insert a character C-n ;; go to next line x ;; insert another character The problem is that your images are smaller than the default height of the screen line, as determined by the 'default' face. So slices of the image do not produce a single circle, but two semi-circles with empty space between them. If this is the problem, then I see nothing wrong with this: to have the two slices come together, you need to fit the size of the image to the height of the default face.