0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

お絵かきできるSNSを作りたい!7

Last updated at Posted at 2020-05-14

線の太さを実装していきたいと思います。

↓この部分
WS000002.JPG

前回同様、今度は[type="range"]の値を取得し、lineWidthに入れるだけです。

<input type="range" value="1" min="1" max="10" step="1" oninput="LineWidth(this)">
<output id="LineWidthValue">1</output>pixel
//線の太さ用変数(デフォルトは1px)
var strLineWidth="1";

function LineWidth(obj){
	document.getElementById('LineWidthValue').value=obj.value;
	strLineWidth=obj.value;
}

最後に

	ct.lineWidth=strLineWidth;

↑ここだけだと伝わらないと思うので↓のgithubの差分をを参照ください。

これで線の太さ変更が可能になりました。
WS000003.JPG

次:お絵かきできるSNSを作りたい!8
最初:お絵かきできるSNSを作りたい!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?