-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrawline.js
More file actions
298 lines (243 loc) · 22.5 KB
/
drawline.js
File metadata and controls
298 lines (243 loc) · 22.5 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
import {line,height,isDrawDivision, ctxList,ctx,stop, currentBTN} from "./field.js";
import {noteType} from "./option.js";
let drawingCTX;
let MinusCircleSIZE = 0;
const circleAdjustHeight = 60;
const NOTE_WIDTH = {
4 : 150,
5 : 120,
6 : 100,
8 : 100,
}
const drawline = {
4: line4,
5: line5,
6: line6,
8: line8,
};
export function changeNoteSize(value){
console.log("노트크기:"+value);
MinusCircleSIZE = 50 - value;
}
function heightOriginOrCopy(note){
return note.ctx.canvas.parentNode.id == 'cv-container' ? height- note.time : note.ctx.canvas.height- note.time
}
function isCurrentCTX(ctx){
return ctx.canvas.parentNode.id == drawingCTX;
}
function drawcircle(note, x, y, color){
let ctx = note.ctx;
ctx.beginPath();
ctx.strokeStyle = color;
ctx.lineWidth = 3;
if(note.height == 15){ //일반노트
ctx.arc(x + NOTE_WIDTH[currentBTN]/2, y - circleAdjustHeight, NOTE_WIDTH[currentBTN]/2 - MinusCircleSIZE, 0, 2*Math.PI, true);
}else{ //롱노트
ctx.arc(x + NOTE_WIDTH[currentBTN]/2, y - circleAdjustHeight, NOTE_WIDTH[currentBTN]/2 -MinusCircleSIZE, 0, 1*Math.PI, true);
ctx.stroke();
ctx.beginPath();
ctx.arc(x + NOTE_WIDTH[currentBTN]/2, y+note.height - circleAdjustHeight, NOTE_WIDTH[currentBTN]/2 -MinusCircleSIZE, 0, 1*Math.PI, false);
ctx.stroke();
ctx.moveTo(x+MinusCircleSIZE,y - circleAdjustHeight);
ctx.lineTo(x+MinusCircleSIZE,y+note.height - circleAdjustHeight);
ctx.moveTo(x+NOTE_WIDTH[currentBTN]-MinusCircleSIZE,y - circleAdjustHeight );
ctx.lineTo(x+NOTE_WIDTH[currentBTN]-MinusCircleSIZE,y+note.height - circleAdjustHeight);
}
//내부채우기
// ctx.fillStyle = color;
// ctx.fill();
//그리기
ctx.stroke();
}
function line4(){
drawingCTX = stop ? 'copy-cv-container' : 'cv-container';
if(isDrawDivision){
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineWidth = 1);
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.beginPath());
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=> ctx.strokeStyle = "gray");
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN],0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN],ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*2,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*2,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*3,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*3,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.stroke());
}
if(noteType == "square"){
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "aquamarine");
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(0, heightOriginOrCopy(note) , 300, note.height));
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "aquamarine");
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(300, heightOriginOrCopy(note) , 300, note.height));
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "white");
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(0, heightOriginOrCopy(note) , 150, note.height));
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "blue");
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(150, heightOriginOrCopy(note) , 150, note.height));
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "blue");
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(300, heightOriginOrCopy(note) , 150, note.height));
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "white");
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(450, heightOriginOrCopy(note) , 150, note.height));
}else{
//circle
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "aquamarine");
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(0, heightOriginOrCopy(note) - circleAdjustHeight, 300, note.height));
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "aquamarine");
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(300, heightOriginOrCopy(note) - circleAdjustHeight, 300, note.height));
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*0 , heightOriginOrCopy(note), "white"));
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*1, heightOriginOrCopy(note), "blue"));
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*2, heightOriginOrCopy(note),"blue"));
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*3, heightOriginOrCopy(note), "white"));
}
}
function line5(){
drawingCTX = stop ? 'copy-cv-container' : 'cv-container';
if(isDrawDivision){
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineWidth = 1);
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.beginPath());
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.strokeStyle = "gray");
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN],0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN],ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*2,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*2,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*3,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*3,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*4,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*4,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.stroke());
}
if(noteType == "square"){
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "aquamarine");
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(0, heightOriginOrCopy(note), 300, note.height) );
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "aquamarine");
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(300, heightOriginOrCopy(note), 300, note.height) );
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(0, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "blue");
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN], heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*2, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "blue");
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*2, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[6].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[6].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*3, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[7].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "blue");
line[7].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*4, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
}else{
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "aquamarine");
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(0, heightOriginOrCopy(note) - circleAdjustHeight, 300, note.height));
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "aquamarine");
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(300, heightOriginOrCopy(note) - circleAdjustHeight, 300, note.height));
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*0 , heightOriginOrCopy(note), "white"));
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*1, heightOriginOrCopy(note), "blue"));
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*2, heightOriginOrCopy(note),"white"));
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*2, heightOriginOrCopy(note), "blue"));
line[6].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*3, heightOriginOrCopy(note), "white"));
line[7].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*4, heightOriginOrCopy(note), "blue"));
}
}
function line6(){
drawingCTX = stop ? 'copy-cv-container' : 'cv-container';
if(isDrawDivision){
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineWidth = 1);
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.beginPath());
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.strokeStyle = "gray");
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN],0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN],ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*2,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*2,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*3,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*3,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*4,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*4,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*5,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*5,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.stroke());
}
if(noteType == "square"){
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "aquamarine");
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(0, heightOriginOrCopy(note), 300, note.height) );
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "aquamarine");
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(300, heightOriginOrCopy(note), 300, note.height) );
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(0, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "blue");
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN], heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*2, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*3, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[6].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "blue");
line[6].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*4, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[7].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[7].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*5, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
}else{
//circle
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "aquamarine");
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(0, heightOriginOrCopy(note) - circleAdjustHeight, 300, note.height));
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "aquamarine");
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(300, heightOriginOrCopy(note) - circleAdjustHeight, 300, note.height));
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*0 , heightOriginOrCopy(note), "white"));
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*1, heightOriginOrCopy(note), "blue"));
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*2, heightOriginOrCopy(note),"white"));
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*3, heightOriginOrCopy(note), "white"));
line[6].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*4, heightOriginOrCopy(note), "blue"));
line[7].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*5, heightOriginOrCopy(note), "white"));
}
}
function line8(){
drawingCTX = stop ? 'copy-cv-container' : 'cv-container';
if(isDrawDivision){
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineWidth = 1);
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.beginPath());
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.strokeStyle = "gray");
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN],0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN],ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*2,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*2,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*3,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*3,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*4,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*4,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.moveTo(NOTE_WIDTH[currentBTN]*5,0));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.lineTo(NOTE_WIDTH[currentBTN]*5,ctx.canvas.height));
ctxList.filter((ctx)=>isCurrentCTX(ctx)).forEach((ctx)=>ctx.stroke());
}
if(noteType == "square"){
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "aquamarine");
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(0, heightOriginOrCopy(note), 300, note.height) );
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "aquamarine");
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(300, heightOriginOrCopy(note), 300, note.height) );
line[8].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "red");
line[8].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(0, heightOriginOrCopy(note), 300, note.height) );
line[9].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "red");
line[9].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(300, heightOriginOrCopy(note), 300, note.height) );
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(0, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "blue");
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN], heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*2, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*3, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[6].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "blue");
line[6].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*4, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
line[7].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "white");
line[7].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(NOTE_WIDTH[currentBTN]*5, heightOriginOrCopy(note), NOTE_WIDTH[currentBTN], note.height) );
}else{
//circle
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "aquamarine");
line[0].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(0, heightOriginOrCopy(note) - circleAdjustHeight, 300, note.height));
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillStyle = "aquamarine");
line[1].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=>note.ctx.fillRect(300, heightOriginOrCopy(note) - circleAdjustHeight, 300, note.height));
line[8].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "red");
line[8].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(0, heightOriginOrCopy(note) - circleAdjustHeight, 300, note.height) );
line[9].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillStyle = "red");
line[9].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> note.ctx.fillRect(300, heightOriginOrCopy(note) - circleAdjustHeight, 300, note.height) );
line[2].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*0 , heightOriginOrCopy(note), "white"));
line[3].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*1, heightOriginOrCopy(note), "blue"));
line[4].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*2, heightOriginOrCopy(note),"white"));
line[5].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*3, heightOriginOrCopy(note), "white"));
line[6].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*4, heightOriginOrCopy(note), "blue"));
line[7].notes.filter((note)=>isCurrentCTX(note.ctx)).forEach((note)=> drawcircle(note, NOTE_WIDTH[currentBTN]*5, heightOriginOrCopy(note), "white"));
}
}
export {drawline}