Raphael.js 2.0 beta release is out - GitHub
github.com
github.com
http://thechangelog.com/post/631899187/episode-0-2-5-rapha-l...
I have massive respect for Dmitry's pure abilities and the library as a whole, but trying to contribute is pretty frustrating.
Or, for that matter, per-version documentation.
• New transformation API and implementation, dramatically faster and flexible (full support for matrix transformations) • New animation API extension • Fix for subpixel rendering in IE • New arrowhead attributes • Improved getBBox calculation • Fix for HSB and HSL • Added viewBox support • New built-in event system • and lots of tiny bug fixes
What does ~~num do?
So ~~num I think would return the original value. The only reason I can see would be to coerce it into some kind of number type.
The other way to write it is 0|num which has the advantage of only applying one bitwise op.
These tend to crop up most often in graphics oriented libraries.
Edit: Double checked the spec (it's quite readable) and the main difference is that + will coerce ignoring whitespace while parseFloat will ignore leading whitespace and parse leading digits. E.g. var x = '1.23foo'; parseFloat(x) is 1.23; +x is NaN. Neither looks like it should be faster than the other.
I tried it:
round("2.2") -> 2.2
round(2.2) -> 2.2
round("2.6") -> 2.6
round(2.6) -> 2.6
Raphaël adds 0.5 to the values in SVG in order to make one-pixel-wide lines render as a single pixel instead of two.