w3c / 2dcontext Goto Github PK
View Code? Open in Web Editor NEWMoved to https://html.spec.whatwg.org/multipage/canvas.html
Moved to https://html.spec.whatwg.org/multipage/canvas.html
From
https://lists.w3.org/Archives/Public/public-canvas-api/2015JulSep/0000.html
On setting, if the new value is one of the literal strings butt, round, and square, then the current value must be changed to the new value; other values must ignored, leaving the value unchanged.
must ignored => must be ignored
General request:
Please change from Sentence. [CITATION] Sentence. to: Sentence
[CITATION]. Sentence.
It's really painful to read the former, as in:
On setting, strings must be parsed as CSS values and the color assigned, and CanvasGradient and CanvasPattern objects must be assigned themselves. [CSSCOLOR] If the value is a string but cannot be parsed as a CSS value, or is neither a string, a CanvasGradient, nor a CanvasPattern, then it must be ignored, and the attribute must retain its previous value.
As it appears that the 2D context keeps track of the position of the "pen" and uses it in methods such as lineTo()
and as knowing that current position could be useful for drawing connected segments or for extending the context with other methods which would need to be aware of the current position, would w3c consider adding a penX
and penY
property (or getter methods) that expose the data through the Canvas API?
I recognize we could track this ourselves, but we would be creating duplicate data in the process.
Thanks for your hard work.
From
https://lists.w3.org/Archives/Public/public-canvas-api/2015JulSep/0000.html
particular case (e.g. because the element is not in a Document), then the "computed value of the 'color' property" for the purposes of determining the computed value of
the currentColor keyword is fully opaque black. [CSSCOLOR]
the underline from in a Document
runs over the next line in
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:39.0) Gecko/20100101
Firefox/39.0
From
https://lists.w3.org/Archives/Public/public-canvas-api/2015JulSep/0000.html
[[
There's no "inform the user of the removal of the region" step, which
is odd, given the parallel for informing the user when it was added.
]]
From
https://lists.w3.org/Archives/Public/public-canvas-api/2015JulSep/0000.html
void arc(unrestricted double x, unrestricted double y, unrestricted double radius, unrestricted double startAngle, unrestricted double endAngle, optional boolean anticlockwise = false);
w3 is en-us, I understand that whatwg's html editor isn't, but...
anticlockwise [About 1,050,000 results] should really be
counterclockwise [About 11,400,000 results]
From
https://lists.w3.org/Archives/Public/public-canvas-api/2015JulSep/0000.html
context . lineDashOffset
...
Can be set, to change the phase offset. Values that are not finite values are ignored.
shouldn't this have [= value] ?
From
https://lists.w3.org/Archives/Public/public-canvas-api/2015JulSep/0000.html
here, the shortest variants are first:
void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, unrestricted double dx, unrestricted double dy);
void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
here, the longest is first:
void putImageData(ImageData imagedata, double dx, double dy, double dirtyX, double dirtyY, double dirtyWidth, double dirtyHeight);
void putImageData(ImageData imagedata, double dx, double dy);
any reason?
From
https://lists.w3.org/Archives/Public/public-canvas-api/2015JulSep/0000.html
Cut the line on which end finds itself short at end and place a point there, cutting the subpath that it was in in two;
in in
while technically correct is painful to read
i think it's possible to write cutting its containing subpath in two
Copied from @jacobp100 (to check IPR...), in w3c/html#1230
We can currently use SVG path data to construct a Path2D
object.
const path = new Path2D("M10 10 h 80 v 80 h -80 Z");
We can also use this path in ctx.fill
and ctx.stroke
.
ctx.stroke(new Path2D("M10 10 h 80 v 80 h -80 Z"));
Would it be consistent to allow path data to be used directly in fill
and stroke
? This would remove indirection. It make this feature more visible to users.
ctx.stroke("M10 10 h 80 v 80 h -80 Z");
From
https://lists.w3.org/Archives/Public/public-canvas-api/2015JulSep/0000.html
Jump to the first appropriate step:
I expected an actual jump
somewhere in here, there wasn't. even more
confusingly, only the first of three items said continue to the next step
, which implied to me that the other two didn't continue to the next step
, i couldn't figure where i should jump to from them.
Return to the step labeled dash on.
I'm used to return
for subroutines, but this isn't. I'd expect
Jump
or Go
instead.
The round value means that a semi-circle with the diameter equal to the styles lineWidth width must additionally be placed on to the line coming out of each point.
on to => onto
Points with no lines coming out of them must have two caps placed back-to-back as if it was really two points connected to each other by an infinitesimally short straight line in the direction of the point's directionality (as defined above).
it => each || it was => they [each?] were
(because the active article is points
plural and not singular;
alternatively Points => Each point ; but then you have to do something
about out of them
)
Let the anchor point's vertical position be half way between the bottom and the top of the em box of the first available font of the inline box.
halfway
context . arcTo(x1, y1, x2, y2, radius)
Adds an arc with the given control points and radius to the current subpath, connected to the previous point by a straight line.
Throws an IndexSizeError exception if the given radius is negative.
there's an empty white box here....
4 Text styles
context . font [ = value ]
dl.domintro:before { display: table; margin: -1em -0.5em -0.5em auto;
width: auto; content: 'This definition is non-normative.
Implementation requirements are given below this definition.'; color:
#606060; border:1px solid lightgray; background: white; padding: 0
0.25em;font-size:.9em;}
This doesn't work well for small windows.
context . bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)
Adds the given point to the current subpath, connected to the previous one by a cubic Bézier curve with the given control points.context . arcTo(x1, y1, x2, y2, radius)
Adds an arc with the given control points and radius to the current subpath, connected to the previous point by a straight line.
shouldn't these be cp1x cp1y cp2x cp2y?
General request:
Please change from Sentence. [CITATION] Sentence. to: Sentence
[CITATION]. Sentence.
It's really painful to read the former, as in:
On setting, strings must be parsed as CSS values and the color assigned, and CanvasGradient and CanvasPattern objects must be assigned themselves. [CSSCOLOR] If the value is a string but cannot be parsed as a CSS value, or is neither a string, a CanvasGradient, nor a CanvasPattern, then it must be ignored, and the attribute must retain its previous value.
Check the usability of the image argument. If this returns aborted, then an exception has been thrown and the method doesn't return anything; abort these steps.
what method does and the method doesn't return anything
refer to,
and what is doing the return
ing? what does createPattern(...)
return for this case?
If it returns bad, then return null and abort these steps.
Note that here createPattern(...)
clearly returned null
before
aborting the steps.
Modifying this image after calling the createPattern() method must not affect the pattern.
change this image
to the stylized image
(italic, grey background)?
["this image" doesn't tightly reference something here.]
Clear the pixels in pixels to a fully transparent black, erasing any previous image.
Does that mean something different than:
Clear the pixels in pixels to fully transparent black, erasing any previous image.
?
If the sx, sy, sw, and sh arguments are omitted, they must default to 0, 0, the image's intrinsic width in image pixels, and the image's intrinsic height in image pixels, respectively.
omitted seems like an odd word. More like if a version that doesn't include them
.
The image argument is an instance of either HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement.
Please omit either
(see usage note [1])
Let arguments be the dictionary object provided as the method's argument.
it's confusing to use a plural to refer to a singular thing. I'd
suggest argument
.
inform the user of the location of the region representing the control given by the control member's value for this canvas element, if any.
I'm not sure what user
means. I probably doesn't mean "human", and
it shouldn't mean "user agent", since the UA is doing the work, it
might mean Accessibility Agent.
When the removeHitRegion() method is invoked, the user agent must run the following steps:
When the clearHitRegions() method is invoked, the user agent must run the following steps:
There's no "inform the user of the removal of the region" step, which
is odd, given the parallel for informing the user when it was added.
If these steps say to act as normal,
the italics here is nice, it'd be helpful if the same italics carried
through into the steps.
for (var y = 1; y < h-1; y += 1) {
...
outputData[i] = 127 + -inputData[i - w_4 - 4] - inputData[i - w_4] - inputData[i - w_4 + 4] +
-inputData[i - 4] + 8_inputData[i] - inputData[i + 4] +
for longer expressions, you include spaces around -
when you use it
for subtract
(as opposed to sign negation). Notably, you use i - 4
instead of i-4
. I'd suggest you do the same for the shorter
expressions too.[It looks like you don't include spaces around *
as
a way to indicate precedence in order of operations.]
and either the shadowBlur is non-zero, or the shadowOffsetX is non-zero, or the shadowOffsetY is non-zero.
[1] -- I'd suggest at least one of shadowBlur, shadowOffsetX, or shadowOffsetY is non-zero
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.