- HTML5 Canvas Cookbook
- Eric Rowell
- 178字
- 2021-08-27 12:08:03
There's more...
HTML5 canvas lines can also have one of three varying line caps, including butt, round, and square. The line cap style can be set using the lineCap
property of the canvas context. Unless otherwise specified, the line cap style is defaulted to butt. The following diagram shows three lines, each with varying line cap styles. The top line is using the default butt line cap, the middle line is using the round line cap, and the bottom line is using a square line cap:

Notice that the middle and bottom lines are slightly longer than the top line, even though all of the line widths are equal. This is because the round line cap and the square line cap increase the length of a line by an amount equal to the width of the line. For example, if our line is 200 px long and 10 px wide, and we use a round or square line cap style, the resulting line will be 210 px long because each cap adds 5 px to the line length.
- Blockchain Quick Start Guide
- 來吧!帶你玩轉(zhuǎn)Excel VBA
- 自動檢測與轉(zhuǎn)換技術(shù)
- Spark大數(shù)據(jù)技術(shù)與應(yīng)用
- 水晶石精粹:3ds max & ZBrush三維數(shù)字靜幀藝術(shù)
- Learning C for Arduino
- 人工智能趣味入門:光環(huán)板程序設(shè)計
- 悟透AutoCAD 2009案例自學(xué)手冊
- Visual C++項(xiàng)目開發(fā)案例精粹
- Cloud Security Automation
- 人工智能技術(shù)入門
- 計算機(jī)組成與操作系統(tǒng)
- 空間機(jī)器人智能感知技術(shù)
- 計算機(jī)應(yīng)用基礎(chǔ)實(shí)訓(xùn)·職業(yè)模塊
- Kubernetes on AWS