From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#46556: 27.1; transparent images are displayed incorrectly if rotated Date: Wed, 17 Feb 2021 20:07:27 +0000 Message-ID: References: <86mtw4tiyg.fsf@gmail.com> <87sg5ww430.fsf@gnus.org> <83blci7hgd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16208"; mail-complaints-to="usenet@ciao.gmane.io" To: Eli Zaretskii , larsi@gnus.org, ynyaaa@gmail.com, 46556@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 17 21:11:47 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 1lCTAn-00043W-JU for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Feb 2021 21:11:45 +0100 Original-Received: from localhost ([::1]:56696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCTAm-0007GZ-E4 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Feb 2021 15:11:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCT7C-0003eS-P8 for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2021 15:08:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCT7C-00038Y-Gb for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2021 15:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lCT7C-0005VK-BV for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2021 15:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Feb 2021 20:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46556 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 46556-submit@debbugs.gnu.org id=B46556.161359246121132 (code B ref 46556); Wed, 17 Feb 2021 20:08:02 +0000 Original-Received: (at 46556) by debbugs.gnu.org; 17 Feb 2021 20:07:41 +0000 Original-Received: from localhost ([127.0.0.1]:45167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lCT6q-0005Um-Lr for submit@debbugs.gnu.org; Wed, 17 Feb 2021 15:07:41 -0500 Original-Received: from outbound.soverin.net ([116.202.65.218]:52335) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lCT6n-0005UV-Qm for 46556@debbugs.gnu.org; Wed, 17 Feb 2021 15:07:38 -0500 Original-Received: from smtp.soverin.net (unknown [10.10.3.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id A585E6013B; Wed, 17 Feb 2021 20:07:31 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.142]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1613592451; bh=cVXt+zyOz38vZakUELVLmHd948RXOpxg5oJ07KknT90=; h=Date:From:To:Subject:References:In-Reply-To:From; b=cEU4p464U4vWNylN9kqF5d7/0Up3WUlfrGOGs6hqRtM/MfAtclXTotInx9zItdT+E E6Di8ff53vZnPZVxgsUuJ3BeX+VkS5J5YyX9OHfQIExeazCj4ZHHmLD3ZlLAu0u+JK GR/dGYob6T8KXsUhr+nLzfN/A4uN98XMfjfhB3xE0qYeYQ7fGzqg47nnG/ctx0aX8m koTtfnQWZeM7ps214IJtJKr9DXPHrZ0zzXkgFG6RkVK5IQq75da+klGozLeR1srD+8 L7F+FxfkacS52KuMm1SEzr1YCD0EVpV9ZyD4/IPi73/bchH2wBBs5oJLMGAZzaGHk0 Kvk1UhHl6t1VQ== Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 13B4A202A80000; Wed, 17 Feb 2021 20:07:27 +0000 (GMT) Mail-Followup-To: Alan Third , Eli Zaretskii , larsi@gnus.org, ynyaaa@gmail.com, 46556@debbugs.gnu.org Content-Disposition: inline In-Reply-To: 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:200218 Archived-At: On Wed, Feb 17, 2021 at 07:26:38PM +0000, Alan Third wrote: > On Wed, Feb 17, 2021 at 07:05:38PM +0200, Eli Zaretskii wrote: > > > Date: Tue, 16 Feb 2021 21:24:24 +0000 > > > From: Alan Third > > > Cc: ynyaaa@gmail.com, 46556@debbugs.gnu.org > > > > > > > Would it be possible for you to test with Emacs 28 and see whether the > > > > problem you report (on Windows) is still present there? > > > > > > It does sound like something must be going wrong on Windows. > > > Unfortunately I don't know what that could be because, as I said on > > > the other bug report, NS and Windows use the same rotation logic, and > > > NS is fine, so it must be when it comes to actually drawing that the > > > problem manifests. > > > > I've now stepped through the code which implements rotation, and I see > > nothing wrong with the results. The pixel coordinates of the rotated > > square are exact and accurate, without any roundoff that I could spot. > > Each square starts exactly 50+8 = 58 pixels after the previous one (8 > > pixels are taken by the SPC character between the squares), and ends > > exactly 50 pixels after it starts. > > > > So I have no idea why the one-pixel shift happens. Of course, I don't > > really understand what that code does (although I hacked it quite > > extensively), so maybe someone who really understands that stuff could > > take a look and tell what's wrong there. > > Can either you or the OP provide a screenshot? It's not entirely clear > to me what's happening. It sounds like some of the behaviour of this > bug would be explained by the mask not being rotated with the image, > but other bits of the description don't seem to match that. > > The other bug with the single pixel white line sounds more like an > off-by-one in SVG production, but you'd see that in every image, so > it's probably not that. In fact, I'm just looking over w32term.c and in the function transform there are two equations: pt.x = x0 + (x - x0) * xform->eM11 + (y - y0) * xform->eM21 + xform->eDx + 0.5f; pt.y = y0 + (x - x0) * xform->eM12 + (y - y0) * xform->eM22 + xform->eDy + 0.5f; What happens if you remove the +0.5f from them? I'm guessing they're there to influence the rounding during conversion from a floating point calculation into an integer? (Also I finally now understand a lot of the problems you had implementing this as it's quite a different approach than the other terminals and the matrices we produce are not a good fit.) -- Alan Third