[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs-29 dc78779c0c: Fix SVG scaling (bug#59802)
From: |
Po Lu |
Subject: |
Re: emacs-29 dc78779c0c: Fix SVG scaling (bug#59802) |
Date: |
Sat, 17 Dec 2022 17:51:44 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Po Lu <luangruo@yahoo.com>
>> Cc: Manuel Giraud <manuel@ledu-giraud.fr>
>> Date: Sat, 17 Dec 2022 09:26:08 +0800
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > + if (! (0 < viewbox_width) && (iwidth.unit == RSVG_UNIT_PERCENT))
>> > + viewbox_width = (viewbox_height * viewbox.width / viewbox.height)
>> > + * iwidth.length;
>> > + else if (! (0 < viewbox_height) && (iheight.unit ==
>> > RSVG_UNIT_PERCENT))
>> > + viewbox_height = (viewbox_width * viewbox.height / viewbox.width)
>> > + * iheight.length;
>>
>> Our style is to write:
>>
>> viewbox_width = ((viewbox_height * viewbox.width / viewbox.height)
>> * iwidth.length);
>>
>> and not:
>>
>> viewbox_width = (viewbox_height * viewbox.width / viewbox.height)
>> * iwidth.length;
>
> There's nothing wrong with the original style, although I agree that
> using extra parentheses makes it more plausible. There's no reason to
> be so stringent in insisting on the other style.
The GNU coding standards seem to say something else:
Insert extra parentheses so that Emacs will indent the code properly.
For example, the following indentation looks nice if you do it by
hand,
v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
+ rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000;
but Emacs would alter it. Adding a set of parentheses produces
something that looks equally nice, and which Emacs will preserve:
v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
+ rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000);