Comments (6)
That was already brought in whatwg/html#5619 (comment) which didn't receive much returns, in either ways.
I wonder if this point shouldn't be brought again on the PR directly now.
FWIW, I personally don't have a strong opinion on this, with a small preference for a single Array, as I feel it is cleaner to have a single signature, and that very long signatures were actually not a great design decision (over the years I often wondered if having a dictionary for drawImage wouldn't have made it more friendly). If you are that much fighting against GC, I guess you could simply store that Array somewhere and reuse it every frame, like you probably already do with a lot of other objects.
But once again, these are not strong oppositions from my side.
from canvas2d.
I'm fine with it too.
@mysteryDate wdyt?
from canvas2d.
I've actually had this on my todo list for a while. I totally agree with a single number for ergonomic reasons, didn't think abuot the garbage collector.
from canvas2d.
@mysteryDate I just did update my polyfill to include this single radius option, however doing so I noticed that the current Chrome's implementation has some weird behavior with some stoopid inputs.
I'm not an IDL expert myself, but I believe that the JS value undefined
should be converted to NaN
by "unrestricted double" (I tested it with globalAlpha
and indeed it is there, at least observably: the value did not change).
However, in roundRect
undefined
will be (observably) treated as 0
: the rectangle will be drawn.
This is true for both roundRect(x, y, w, h, undefined)
and roundRect(x, y, w, h, [undefined])
.
Also the behavior of an Array as the first member of a list in radii seems similarly broken:
passing roundRect(x, y, w, h, [[20]])
treats radii as 0
(a rectangle with no rounded border is drawn), while if I'm not mistaken, [20]
to unrestricted double should be 20
.
Here is a fiddle with these observations you can check: https://jsfiddle.net/oxvqm597/
And here the same fiddle ran through my polyfill: https://jsfiddle.net/oxvqm597/1/
Could you please confirm that my reading is correct?
from canvas2d.
whatwg/html#7592
whatwg/html#7621
from canvas2d.
Closing this as we merged it! Thanks a lot for the feedback. :)
from canvas2d.
Related Issues (20)
- Serialization of CanvasFilters HOT 1
- CanvasFilters - Even <feImage>?
- CanvasFilters - How do we set the dimensions of the filter? HOT 3
- Reset / Clear
- Text Modifiers — Variable Fonts HOT 1
- Color Input - P3 examples HOT 1
- Proposals HOT 11
- Make CSS filters work with `CanvasFilter` HOT 3
- Use GLES fragment shader as filters
- Gradient spread methods
- Arbitrary gradient transforms HOT 3
- Integer only coordinate space mode. HOT 7
- `beginLayer` vs `beginFilter` HOT 2
- add clipRect() function HOT 2
- Web platform brianstorm meeting in California
- Make canvas2d faster than Webgl
- [Mesh2D] Triangle order HOT 2
- [Mesh] constructors vs factory functions HOT 1
- [Mesh] are the objects necessary at all? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from canvas2d.