forked from demitov/dashApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDashMask.qml
51 lines (43 loc) · 1.4 KB
/
DashMask.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import QtQuick 2.9
Canvas {
id: mask
width: 800
height: 600
onPaint: {
var ctx = getContext("2d");
ctx.lineWidth = 1
ctx.strokeStyle = "white"
//внешний круг
ctx.beginPath();
ctx.arc(mask.width/2,mask.height/2,210,Math.PI, 4*Math.PI, false);
ctx.stroke();
ctx.closePath();
//внутренний круг
ctx.beginPath();
ctx.arc(mask.width/2,mask.height/2,185,Math.PI, 4*Math.PI, false);
ctx.stroke();
ctx.closePath();
//левый край
ctx.beginPath();
ctx.arc(mask.width/2,mask.height/2,300, 145*Math.PI/180, 215*Math.PI/180, false);
ctx.moveTo(154,128);
ctx.lineTo(200,128);
ctx.moveTo(100,mask.height/2);
ctx.arc(mask.width/2,mask.height/2,264, 180*Math.PI/180, 221*Math.PI/180, false);
ctx.moveTo(154,472);
ctx.lineTo(200,472);
ctx.stroke();
ctx.closePath();
//правый край
ctx.beginPath();
ctx.arc(mask.width/2,mask.height/2,300, 35*Math.PI/180, 325*Math.PI/180, true);
ctx.moveTo(646,128);
ctx.lineTo(600,128);
ctx.moveTo(700,mask.height/2);
ctx.arc(mask.width/2,mask.height/2,264, 0*Math.PI/180, 319*Math.PI/180, true);
ctx.moveTo(646,472);
ctx.lineTo(600,472);
ctx.stroke();
ctx.closePath();
}
}