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 13:54:05 +0300 Message-ID: <83v8vq30aa.fsf@gnu.org> References: <83zgl235pb.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39507"; 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 12:55:13 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 1naxt2-000AA3-Ef for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Apr 2022 12:55:12 +0200 Original-Received: from localhost ([::1]:39466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naxt1-0003iJ-2X for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Apr 2022 06:55:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naxst-0003iA-1A for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2022 06:55:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1naxss-0000aJ-Oq for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2022 06:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1naxss-0004j1-F6 for bug-gnu-emacs@gnu.org; Sun, 03 Apr 2022 06:55: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 10:55: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.164898325418101 (code B ref 54688); Sun, 03 Apr 2022 10:55:02 +0000 Original-Received: (at 54688) by debbugs.gnu.org; 3 Apr 2022 10:54:14 +0000 Original-Received: from localhost ([127.0.0.1]:47703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naxs6-0004ht-EL for submit@debbugs.gnu.org; Sun, 03 Apr 2022 06:54:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1naxs3-0004hg-Qu for 54688@debbugs.gnu.org; Sun, 03 Apr 2022 06:54:12 -0400 Original-Received: from [2001:470:142:3::e] (port=34408 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 1naxry-0000XH-Hz; Sun, 03 Apr 2022 06:54: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=aMb8MiYuL1yiSeXIUTdv9JfkqHnpz9nt/a0D8EeleXw=; b=bsCAE2LXspM2 +gsDPgbq417gt7eymUlAz5zhBWx8J3P4wz+sMapyMlWhNLsHvmrqfpEpeO1oJzP6oxLwk1CCJjDWG mrgJFAaNqZEuFGkBEO3Bc+G55Ok7xBw/d5QDcQzCBBS0rorYBninavH87XdCI+J6SLQbjLEY2qXEa xLOmlnG6p2Yz5sr8O08n2ys/LHsWEmi5S6e3+yhsYFzSBNdSlhV2ZvATM1Wc1rUfCUBYWdxzHAGpA Z52X2PC6MtBEguhaHYGD/vQDuGJpxQ7bhcxm/b0eexOLLUxTJR8rQz53YRH07zVZJtmsy/tPRWd30 Z1cH736TB9REgb+jre02tw==; Original-Received: from [87.69.77.57] (port=4890 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 1naxrx-0000PU-U2; Sun, 03 Apr 2022 06:54:06 -0400 In-Reply-To: (message from dalanicolai on Sun, 3 Apr 2022 12:33:01 +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:229328 Archived-At: > From: dalanicolai > Date: Sun, 3 Apr 2022 12:33:01 +0200 > Cc: 54688@debbugs.gnu.org > > Thank you for the quick reply. However, the height of the image, > (* 2 (line-pixel-height)), is equal to twice the `default-font-height` > (the 'line-pixel-height' and 'default-font-height' are equal, here both > 17). > > So before I add the character after the image, (line-pixel-height) > returns 17. But when I insert a character after it (with > 'default-font-height' is 17), the `line-pixel-height` increases to > 22. So I am not sure how to not let the line height increase. > I will try to play a little with the :ascent value. Images can also have margins: int image_ascent (struct image *img, struct face *face, struct glyph_slice *slice) { int height; int ascent; if (slice->height == img->height) height = img->height + img->vmargin; else if (slice->y == 0) height = slice->height + img->vmargin; else height = slice->height; Maybe those make the difference? In any case, once I add a character, the line height grows, which tells us some vertical dimension somewhere is unaccounted for.