LineJoin қасиеті
lineJoin қасиеті екі сызықты біріктіру
әдісін белгілейді. Келесі мәндерді қабылдай алады:
miter - сүйір бұрыш (әдепкі бойынша),
round - дөңгелектенген бұрыш, bevel
- жазық бұрыш.
Синтаксис
контекст.lineJoin = 'miter' немесе 'round' немесе 'bevel';
Мысал
lineJoin қасиетін meter мәніне орнатайық:
<canvas id="canvas" width="200" height="200" style="background: #f4f4f4;"></canvas>
let canvas = document.querySelector('#canvas');
let ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.lineWidth = 10;
ctx.lineJoin = 'meter';
ctx.moveTo(50, 140);
ctx.lineTo(100, 30);
ctx.lineTo(150, 140);
ctx.stroke();
:
Мысал
lineJoin қасиетін round мәніне орнатайық:
<canvas id="canvas" width="200" height="200" style="background: #f4f4f4;"></canvas>
let canvas = document.querySelector('#canvas');
let ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.lineWidth = 10;
ctx.lineJoin = 'round';
ctx.moveTo(50, 140);
ctx.lineTo(100, 30);
ctx.lineTo(150, 140);
ctx.stroke();
:
Мысал
lineJoin қасиетін bevel мәніне орнатайық:
<canvas id="canvas" width="200" height="200" style="background: #f4f4f4;"></canvas>
let canvas = document.querySelector('#canvas');
let ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.lineWidth = 10;
ctx.lineJoin = 'bevel';
ctx.moveTo(50, 140);
ctx.lineTo(100, 30);
ctx.lineTo(150, 140);
ctx.stroke();
:
Сондай-ақ қараңыз
-
miterLimitқасиеті,
ол сүйір бұрыштың ұзындығын шектейді -
lineCapқасиеті,
ол сызықтың ұшының түрін белгілейді