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#67533: SVG images confound position pixel measurements Date: Sun, 03 Dec 2023 17:52:12 +0200 Message-ID: <83jzpv707n.fsf@gnu.org> References: <9B9C683E-B951-406E-98AA-32F4539B3FF7@gmail.com> <83o7fbb0zf.fsf@gnu.org> <6158BB83-3C05-4CEC-BF65-A6C0DEA329CD@gmail.com> <837clybds3.fsf@gnu.org> <83wmtx83io.fsf@gnu.org> <906A480A-85B4-4AB0-B2E3-1533A48C228D@gmail.com> <835y1g8z7v.fsf@gnu.org> <8334wk8kd1.fsf@gnu.org> <8672011B-4C83-4983-9DEA-43ED009042F8@gmail.com> <616C9D31-F265-4735-B73E-C0574D79F7F1@gmail.com> <83r0k3782q.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4797"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67533@debbugs.gnu.org To: JD Smith Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 03 16:52:58 2023 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 1r9omA-000100-Ab for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Dec 2023 16:52:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9om5-0006zO-Tk; Sun, 03 Dec 2023 10:52:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9om4-0006zG-Ex for bug-gnu-emacs@gnu.org; Sun, 03 Dec 2023 10:52:52 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9om4-0004Rg-6e for bug-gnu-emacs@gnu.org; Sun, 03 Dec 2023 10:52:52 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r9omE-0004WG-4o for bug-gnu-emacs@gnu.org; Sun, 03 Dec 2023 10:53:02 -0500 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 Dec 2023 15:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67533 X-GNU-PR-Package: emacs Original-Received: via spool by 67533-submit@debbugs.gnu.org id=B67533.170161875017330 (code B ref 67533); Sun, 03 Dec 2023 15:53:02 +0000 Original-Received: (at 67533) by debbugs.gnu.org; 3 Dec 2023 15:52:30 +0000 Original-Received: from localhost ([127.0.0.1]:60645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9olh-0004VR-Pd for submit@debbugs.gnu.org; Sun, 03 Dec 2023 10:52:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9ole-0004VE-LH for 67533@debbugs.gnu.org; Sun, 03 Dec 2023 10:52:27 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9olP-0004OS-35; Sun, 03 Dec 2023 10:52:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=FLkFy6iElCQACaFqimiaGfJmOav+5mErABVO3dP9Lkc=; b=m7X4i71+V162p5euM/Lg t+Xo8WG1D4F2c3go1DF4Ob32tG784pGAAdW8UeIBrphTcaPJjb8XWErX5eiZeLKoXMNJNyqXDfrWo +csLgwAQxVJ6o5iMx9Hxb0AyyjVGc1QTfElj5mc7mojvHF10IsfNY84XDZRT0Fw5uqf2yABV+rQHt li4FWMmjB7UkLLNKMRcjksM4ZqjaXFCUEO1xaPt+9EfKvyHq9qtxdcZlLnVxV12ghmBzOTo8sYoPH KbCyo5BDEb9KXL3qBoCkZn+3u1ACFYPBIFoHDHSq9b7pv+V3TDWfPeOZvtMzE4CO5jN0SjZMzoZt1 RMN0WCgv8ynPzQ==; In-Reply-To: (message from JD Smith on Sun, 3 Dec 2023 10:48:20 -0500) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275425 Archived-At: > From: JD Smith > Date: Sun, 3 Dec 2023 10:48:20 -0500 > Cc: 67533@debbugs.gnu.org > > > The cumulative patch below should fix all the problems you threw on me > > till now. > > Most excellent, thank you for the sleuthing Eli! Your roll-up patch applies cleanly and fixes all the pixel size related issues in my large complex org-with-latex-preview file. I can induce the same behavior in my original svg-generating code by bumping the default width up to: > > (w (+ 142 (* 2 (round (expt (1+ r) 1.25))))) > > and it solves it there too. (I’ve updated the gist to do this, and included the final function below, for posterity). Thanks, I will install the changes (on master) soon. > Now, because every good novel has a denouement, there’s... one more thing. When I was running my/check-buffer-pixel-values in my large latex-preview-laden org file with your new patch, everything was going swimmingly. No reported problems at all at a variety of frame widths. But, then, at a single magic frame width (81 chars, but I think this is arbitrary), a bunch of `expected 28 got 14’ errors showed up on one particular line. > > A new flavor of under-reported pixel size? No! In fact, all the characters on the reported line were yielding the correct size above themselves. Instead, around this line, (vertical-motion) as well as previous/next line is *skipping a screen line*, confusing my test! I have sometimes seen this while using up/down arrow to navigate such image-rich files, when an image is wrapped to column zero. E.g. instead of moving directly up, point jumps to the end of the line above. > > Given that the size problems are fixed, I think I should try to isolate this motion problem and submit it as a separate bug. So far it has eluded a simple reproduction. I’ve included a short movie of the effect in a gist comment[1] to spurs some thoughts. Yes, a separate bug would be good. In general, vertical-motion can go awry when there are too many images, so I'll withdraw judgment until I see the issue.