gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [patch #8904] Patches to fix special stroke size handling


From: Nutchanon Wetchasit
Subject: [Gnash-commit] [patch #8904] Patches to fix special stroke size handling in `MovieClip.lineStyle()`
Date: Thu, 18 Feb 2016 11:28:23 +0000
User-agent: Opera/9.80 (Windows NT 5.1; U; en) Presto/2.9.168 Version/11.51

Follow-up Comment #2, patch #8904 (project gnash):

Patch 2 of 2:
See the attached `0002_treat-impossible-line-size-as-zero.patch`.

Current Gnash's implementation `MovieClip.lineStyle()` treats line thickness
of `Infinity` as 255 <https://savannah.gnu.org/bugs/?45731#comment3>, while
Flash Player treats it (together as other
impossible line size like negative number, and NaN) as 0.

This patch adds a special-case check to `MovieClip.lineStyle()` which
explicitly set the line size to zero (hairline stroke) when `Infinity`,
`-Infinity` or `NaN` line size value is encountered.

Automated tests will follow as a separate patch entry.

Note:
* In original code, behavior of `NaN` line size is correct but it depends on
order of comparison used inside `clamp()` function
<http://git.savannah.gnu.org/cgit/gnash.git/tree/libbase/GnashNumeric.h?id=051aa9c34b69e1a0a1d2d75e3cf1db07fcea4006#n75>.
Explicit `NaN` check is added to ensure correct behavior regardless of how
`clamp()` was implemented.
* I'm not sure why `clamp()` function was used as `<float>` rather than
`<double>` despite `toNumber()` returning `double`
<http://git.savannah.gnu.org/cgit/gnash.git/tree/libcore/vm/VM.h?id=051aa9c34b69e1a0a1d2d75e3cf1db07fcea4006#n408>
and `pixelsToTwips()` accepting `double` argument
<http://git.savannah.gnu.org/cgit/gnash.git/tree/libbase/GnashNumeric.h?id=051aa9c34b69e1a0a1d2d75e3cf1db07fcea4006#n143>.
I left this part intact as nearby code seems to do similar thing.

Gnash: 0.8.11dev (patched against git 051aa9c 15-Feb-2016)
System: Debian GNU/Linux 7.0 Wheezy i386


(file #36380)
    _______________________________________________________

Additional Item Attachment:

File name: 0002_treat-impossible-line-size-as-zero.patch Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8904>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]