forked from NoahCodes23/Driver-Dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathp5controls.js
More file actions
1983 lines (1489 loc) · 51.3 KB
/
p5controls.js
File metadata and controls
1983 lines (1489 loc) · 51.3 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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
class P5ControlStyle {
buttonColor = color(200);
buttonBorderColor = color(0);
buttonTextColor = color(0);
buttonClickedColor = color(0);
buttonClickedBorderColor = color(0);
buttonClickedTextColor = color(255);
labelColor = color(0);
textBoxColor = color(255);
textBoxBorderColor = color(0);
textBoxTextColor = color(0);
textBoxPadding = 8;
textBoxBlinkerSpeed = 50;
textBoxBlinkerColor = color(0);
textBoxSelectionColor = color(200);
checkBoxCheckColor = color(0);
toolTipColor = color(255);
toolTipTextColor = color(0);
toolTipPadding = 4;
listBoxColor = color(255);
listBoxBorderColor = color(0);
listBoxTextColor = color(0);
listBoxSelectedColor = color(0);
listBoxSelectedTextColor = color(255);
}
class P5Button {
type = "Button";
parent; window; style;
isResizable = true;
initialized = false;
text = "Button";
anchorLeft = true;
anchorTop = true;
anchorBottom = false;
anchorRight = false;
image;
#x = 5;
#y = 5;
#w = 80;
#h = 25;
absx = 0;
absy = 0;
borderWidth = 2;
#textTop = 0;
#textFits = true;
#hover = false;
#imageX = 0;
#imageY = 0;
get x() {
// Return private x pos
return this.#x;
}
set x(value) {
// Set private x pos
this.#x = value;
}
get y() {
// Return private y pos
return this.#y;
}
set y(value) {
// Set private y pos
this.#y = value;
}
get w() {
// Return private width
return this.#w;
}
set w(value) {
// Set private width
this.#w = value;
if (this.initialized) {
// Check if text fits in the control
this.#textFits = (textWidth(this.text) < this.#w);
// Set image location
this.#imageX = round(this.#w / 2);
}
}
get h() {
// Return private height
return this.#h;
}
set h(value) {
// Set private height
this.#h = value;
if (this.initialized) {
// Update text position
this.#textTop = (this.#h - this.manager.fontSize) / 2 + 1;
// Set image location
this.#imageY = round(this.#h / 2);
}
}
init() { // Called just before showing form
this.initialized = true;
// Update the text position
this.w = this.#w;
this.h = this.#h;
}
render() { // Renders the ctrl to the given canvas
var c = this.parent.canvas;
// Set hover and focus state
this.#hover = this.manager.pointInsideBounds(mouseX, mouseY,
this.absx, this.absy, this.#w, this.#h);
this.focus = (this.#hover && this.window.mouseIsPressed);
// Create vars for current button color pallete
var buttonBorderColor, buttonColor, buttonTextColor;
// Copy values from stylesheet
if (this.focus) {
buttonBorderColor = this.style.buttonClickedBorderColor;
buttonColor = this.style.buttonClickedColor;
buttonTextColor = this.style.buttonClickedTextColor;
} else {
buttonBorderColor = this.style.buttonBorderColor;
buttonColor = this.style.buttonColor;
buttonTextColor = this.style.buttonTextColor;
if (this.#hover && this.window.mouseIsReleased) {
this.onClick();
}
}
// Draw control to panel canvas
c.push();
c.translate(this.#x, this.#y);
c.fill(buttonBorderColor);
c.rect(0, 0, this.#w, this.#h);
c.fill(buttonColor);
c.rect(this.borderWidth, this.borderWidth,
this.#w - 2 * this.borderWidth, this.#h - 2 * this.borderWidth);
if (this.#textFits) {
c.fill(buttonTextColor);
c.textAlign(CENTER, TOP);
c.textStyle(BOLD);
c.text(this.text, 0, this.#textTop, this.#w, this.#h);
c.textAlign(LEFT, TOP);
c.textStyle(NORMAL);
}
// Draw button image if it is set
if (this.image != null) {
c.imageMode(CENTER);
c.image(this.image, this.#imageX, this.#imageY);
c.imageMode(CORNER);
}
c.pop();
}
onClick() { } // Triggered when button is clicked
// Left empty for the user to decide the action
}
class P5ListBox {
type = "ListBox";
parent; window; style;
isResizable = true;
initialized = false;
anchorLeft = true;
anchorTop = true;
anchorBottom = false;
anchorRight = false;
items;
#selectedItem = 0;
borderWidth = 2;
#x = 5;
#y = 5;
#w = 80;
#h = 25;
absx = 0;
absy = 0;
hover = false;
#items = [];
#itemHeight = 16;
#maxLength = 0;
#clippingLength = [];
get x() {
// Return private x pos
return this.#x;
}
set x(value) {
// Set private x pos
this.#x = value;
}
get y() {
// Return private y pos
return this.#y;
}
set y(value) {
// Set private y pos
this.#y = value;
}
get w() {
// Return private width
return this.#w;
}
set w(value) {
// Set private width
this.#w = value;
if (this.initialized) {
// Update text clipping
this.#updateTextClipping();
}
}
get h() {
// Return private height
return this.#h;
}
set h(value) {
// Set private height
this.#h = value;
// Update the maximum listbox capacity
this.#updateMaxLength();
}
get itemHeight() {
// Return private item height value
return this.#itemHeight;
}
set itemHeight(value) {
// Set private item height value
this.#itemHeight = value;
// Update the maximum listbox capacity
this.#updateMaxLength();
}
get selectedItem() {
// Return private selected item value
return this.#selectedItem;
}
set selectedItem(value) {
// Check if value has changed
if (this.#selectedItem != value) {
// Set private selected item value
this.#selectedItem = value;
// Call change event
this.onChange();
}
}
constructor() {
// Create array change handler
var lb = this;
var arrayChangeHandler = {
get: function (target, property) {
return target[property];
},
set: function (target, property, value, receiver) {
target[property] = value;
// Update text clipping when setting an item property
if (lb.initialized) {
// Update text clipping
lb.#updateTextClipping();
}
return true;
}
};
// Set public items array
this.items = new Proxy(this.#items, arrayChangeHandler);
}
init() { // Called just before showing form
this.initialized = true;
// Update the text position
this.w = this.#w;
this.h = this.#h;
}
render() { // Renders the ctrl to the given canvas
var c = this.parent.canvas;
// Set hover and focus state
this.hover = this.manager.pointInsideBounds(mouseX, mouseY, this.absx, this.absy, this.#w, this.#h);
this.focus = (this.hover && this.window.mouseIsPressed);
if (this.focus) {
this.#onClick();
}
if (this.hover && this.window.mouseIsReleased) {
this.onClick();
}
// Draw control to panel canvas
c.push();
c.translate(this.#x, this.#y);
c.fill(this.style.listBoxBorderColor);
c.rect(0, 0, this.#w, this.#h);
c.fill(this.style.listBoxColor);
c.rect(this.borderWidth, this.borderWidth,
this.#w - 2 * this.borderWidth, this.#h - 2 * this.borderWidth);
c.textAlign(LEFT, CENTER);
// Draw the items
for (var i = 0; i < this.#items.length; i++) {
// Check if item fits in the lbx
if (i < this.#maxLength) {
var itemText = "";
var textClipping = this.#clippingLength[i];
// Check if text fits into the item
if (textClipping == -1) {
// If so then set item text to the whole text
itemText = this.#items[i];
} else {
// Else clip the text so that it fits
itemText = this.#items[i].substring(0, this.#clippingLength[i]);
}
// Check if item selected
if (this.selectedItem == i) {
// Draw a highlight rectangle
c.fill(this.style.listBoxSelectedColor);
c.rect(this.borderWidth, this.borderWidth + i * this.#itemHeight,
this.#w - 2 * this.borderWidth, this.#itemHeight);
c.fill(this.style.listBoxSelectedTextColor)
} else {
c.fill(this.style.listBoxTextColor);
}
// Draw the item text
c.text(itemText, 2 * this.borderWidth, this.borderWidth
+ i * this.#itemHeight + this.#itemHeight / 2 + 1);
}
}
c.textAlign(LEFT, TOP);
c.pop();
}
#updateMaxLength() { // Updates the maximum amount of items that fit in a lbx
this.#maxLength = Math.floor((this.#h - 2 * this.borderWidth) / this.#itemHeight);
}
#updateTextClipping() { // Determines the max length of text that fits into the ctrl (for every item)
// Reset clipping length for all items
this.#clippingLength = [];
// Loop through all items
for (var i = 0; i < this.#items.length; i++) {
// Get max length for current item and add it to array
this.#clippingLength.push(this.#getMaxTextLengthForItem(i));
}
}
#getMaxTextLengthForItem(itemNo) { // Returns the max length of text that fits into the ctrl
// Loop through all the characters in the item
for (var i = 0; i < this.#items[itemNo].length; i++) {
// Get length of the substring
var len = textWidth(this.#items[itemNo].substring(0, i));
// Check if it fits into the control
if (len > this.#w - 4 * this.borderWidth) {
// If it doesn't then return the length for which it did
return i - 1;
}
}
// If the text fits into the control then return -1
return -1;
}
#onClick() { // Triggered when listbox is clicked
// Get the clicked item id
var itemClicked = Math.floor((this.parent.mouseY - this.#y - this.borderWidth) / this.#itemHeight);
// If item exists set selected item to it
if (itemClicked > -1 && itemClicked < this.#items.length) {
this.selectedItem = itemClicked;
}
}
onClick() { }
onChange() { }
}
class P5ToolTip {
type = "ToolTip";
parent; window; style;
isResizable = false;
offsetX = 20;
offsetY = 20;
toolTips = [];
#x = 0;
#y = 0;
#w = 100;
#h = 100;
x; y; w; h;
init() { }
render() { // Renders the ctrl to the given canvas
// Get the control that the mouse is currently over
var ctrl = this.parent.controlAtPoint(mouseX, mouseY);
// Check if the window is selected and if its not being resized
// Check if mouse is over control
if (this.window.isOnTop && ctrl != null && !this.window.moveInProgress && !this.window.resizeInProgress) {
// Loop through all the tips
for (var i = 0; i < this.toolTips.length; i++) {
// Get the owner of the tip
var tipCtrl = this.toolTips[i][0];
// Check if the control hovered on matches the owner of the tooltip
if (ctrl == tipCtrl) {
// Get the tooltip text and set the displayed text
this.text = this.toolTips[i][1];
// Set tooltip position
this.#w = textWidth(this.text) + 2 * this.style.toolTipPadding;
this.#h = this.manager.fontSize + 2 * this.style.toolTipPadding;
// Set tooltip dimmensions
this.#x = this.parent.mouseX + this.offsetX;
this.#y = this.parent.mouseY + this.offsetY;
// Draw the tooltip background
stroke(0);
fill(this.style.toolTipColor);
rect(this.#x, this.#y, this.#w, this.#h);
// Draw the tooltip text
noStroke();
fill(this.style.toolTipTextColor);
text(this.text, this.#x + this.style.toolTipPadding, this.#y + this.style.toolTipPadding);
}
}
}
}
addToolTip(ctrl, tipText) { // Adds a tooltip to the specified control
// Push an entry to the 2d array
this.toolTips.push([ctrl, tipText]);
}
}
class P5CheckBox {
type = "CheckBox";
parent; window; style;
isResizable = true;
initialized = false;
text = "CheckBox";
#hover = false;
anchorLeft = true;
anchorTop = true;
anchorBottom = false;
anchorRight = false;
checked = false;
borderWidth = 2;
checkBoxSize = 16;
#x = 5;
#y = 5;
#w = 100;
#h = 16;
absx = 0;
absy = 0;
get x() {
// Return private x pos
return this.#x;
}
set x(value) {
// Set private x pos
this.#x = value;
}
get y() {
// Return private y pos
return this.#y;
}
set y(value) {
// Set private y pos
this.#y = value;
}
get w() {
// Return private width
return this.#w;
}
set w(value) {
// Set private height
this.#w = value;
}
get h() {
// Return private height
return this.#h;
}
set h(value) {
// Set private height
this.#h = value;
}
init() { // Called just before showing form
this.initialized = true;
// Update the text position
this.w = this.#w;
this.h = this.#h;
}
render() { // Renders the ctrl to the given canvas
var c = this.parent.canvas;
// Set hover and focus state
this.#hover = this.manager.pointInsideBounds(mouseX, mouseY,
this.absx, this.absy, this.#w, this.#h);
this.focus = (this.#hover && this.window.mouseIsPressed);
// Create vars for current button color pallete
var buttonBorderColor, buttonColor, buttonTextColor;
// Copy values from stylesheet
if (this.focus) {
buttonBorderColor = this.style.buttonClickedBorderColor;
buttonColor = this.style.buttonClickedColor;
} else {
buttonBorderColor = this.style.buttonBorderColor;
buttonColor = this.style.buttonColor;
buttonTextColor = this.style.buttonTextColo
if (this.#hover && this.window.mouseIsReleased) {
this.#onClick();
}
}
// Draw control to panel canvas
c.push();
c.translate(this.#x, this.#y);
c.fill(buttonBorderColor);
c.rect(0, 0, this.checkBoxSize, this.checkBoxSize);
c.fill(buttonColor);
c.rect(this.borderWidth, this.borderWidth, this.checkBoxSize - 2 * this.borderWidth, this.checkBoxSize - 2 * this.borderWidth);
// Draw check if checked
if (this.checked) {
c.stroke(this.style.checkBoxCheckColor);
c.strokeWeight(2);
c.line(this.borderWidth, this.borderWidth, this.checkBoxSize - this.borderWidth, this.checkBoxSize - this.borderWidth);
c.line(this.checkBoxSize - this.borderWidth, this.borderWidth, this.borderWidth, this.checkBoxSize - this.borderWidth);
c.noStroke();
}
// Draw text
c.fill(this.style.labelColor);
c.text(this.text, 20, 3);
c.pop();
}
#onClick() { // Triggered when checkbox is clicked
// Toggle check
this.checked = !this.checked;
// Call public event handler
this.onClick();
}
onClick() { }
}
class P5PictureBox {
type = "PictureBox";
parent; window; style;
isResizable = true;
initialized = false;
image = MSGBOX_INFO_ICON;
anchorLeft = true;
anchorTop = true;
anchorBottom = false;
anchorRight = false;
#x = 5;
#y = 5;
#w = 30;
#h = 30;
absx = 0;
absy = 0;
get x() {
// Return private x pos
return this.#x;
}
set x(value) {
// Set private x pos
this.#x = value;
}
get y() {
// Return private y pos
return this.#y;
}
set y(value) {
// Set private y pos
this.#y = value;
}
get w() {
// Return private width
return this.#w;
}
set w(value) {
// Set private height
this.#w = value;
}
get h() {
// Return private height
return this.#h;
}
set h(value) {
// Set private height
this.#h = value;
}
init() { // Called just before showing form
this.initialized = true;
// Update the text position
this.w = this.#w;
this.h = this.#h;
}
render() { // Renders the ctrl to the given canvas
var c = this.parent.canvas;
// Draw control to panel canvas
c.push();
c.translate(this.#x, this.#y);
c.image(this.image, 0, 0, this.#w, this.#h)
c.pop();
}
}
class P5TextBox {
type = "TextBox";
parent; window; style;
isResizable = true;
initialized = false;
active = false;
#text = "";
textFits = true;
lines = [];
longestLineLength = 0;
textClipping;
hover = false;
anchorLeft = true;
anchorTop = true;
anchorBottom = false;
anchorRight = false;
numOnly = false;
acceptFloat = false;
maxLength = -1;
multiline = false;
borderWidth = 2;
selectionStart = -1;
selectionEnd = -1;
selectionVertices = [];
textSelected = false;
#cursorPos = 0;
#x = 5;
#y = 5;
#w = 80;
#h = 25;
absx = 0;
absy = 0;
#textTop = 0;
curX = 0;
curY = 0;
curH = 0;
selX = 0;
selY = 0;
selW = 0;
selH = 0;
#blinkerVisibleFor = 0;
blinkerVisible = false;
get x() {
// Return private x pos
return this.#x;
}
set x(value) {
// Set private x pos
this.#x = value;
}
get y() {
// Return private y pos
return this.#y;
}
set y(value) {
// Set private y pos
this.#y = value;
}
get w() {
// Return private width
return this.#w;
}
set w(value) {
// Set private height
this.#w = value;
if (this.initialized) {
// Check if text fits into the control
this.#updateTextClipping();
}
}
get h() {
// Return private height
return this.#h;
}
set h(value) {
// Set private height
this.#h = value;
if (this.initialized) {
// Update text position
this.#textTop = (this.#h - this.manager.fontSize) / 2 + 1;
}
}
get text() {
// Return private text value
return this.#text;
}
set text(value) {
// Set private text value
this.#text = value;
// Split textbox text into lines
this.lines = this.#text.split("\n");
if (this.initialized) {
// Update textbox text clipping
this.#updateTextClipping();
}
// Trigger text changed event
this.onChange();
}
get cursorPos() {
// Return private cursor pos
return this.#cursorPos;
}
set cursorPos(value) {
// Set private cursor pos
this.#cursorPos = value;
// Update cursor location on screen
if (this.lines.length <= 1) {
this.curX = this.style.textBoxPadding + textWidth(this.#text.substring(0, this.cursorPos)) + 1;
this.curH = this.manager.fontSize;
this.curY = this.#textTop - 2;
} else {
var cursorLine = this.#positionToLine(this.#cursorPos);
this.curX = this.style.textBoxPadding + textWidth(this.#text.substring(0, this.cursorPos)) + 1 - this.#getWidthOfLinesPriorTo(cursorLine);
this.curH = this.manager.fontSize;
this.curY = this.#textTop - 2 + cursorLine * this.manager.fontLeading;
}
}
init() { // Called just before showing form
this.initialized = true;
// Update the text position
this.w = this.#w;
this.h = this.#h;
// Update cursor position
this.cursorPos = 0;
}
render() { // Renders the ctrl to the given canvas
var c = this.parent.canvas;
// Set hover state
this.hover = this.manager.pointInsideBounds(mouseX, mouseY, this.absx, this.absy, this.#w, this.#h);
if (!this.active && this.hover && this.window.mouseIsPressed) {
this.#onClick();
}
// Draw control to panel canvas
c.push();
c.translate(this.#x, this.#y);
c.fill(this.style.textBoxBorderColor);
c.rect(0, 0, this.#w, this.#h);
c.fill(this.style.textBoxColor);
c.rect(this.borderWidth, this.borderWidth, this.#w - 2 * this.borderWidth, this.#h - 2 * this.borderWidth);
// Check if textbox selected
if (this.active) {
// Check if text fits
if (this.textFits) {
// Check if text is selected
if (this.textSelected) {
c.fill(this.style.textBoxSelectionColor);
// Draw selection rectangle
c.rect(this.selX, this.selY, this.selW, this.selH);
}
// Check if blinker visible and if text fits
if (this.blinkerVisible) {
// Draw blinker
c.fill(this.style.textBoxBlinkerColor);
c.rect(this.curX, this.curY, 1, this.curH);
}
}
// Increase the blinker visibilty timer
this.#blinkerVisibleFor++;
// If timer reaches the amount of time it should be visible
if (this.#blinkerVisibleFor == this.style.textBoxBlinkerSpeed) {
// Reset timer
this.#blinkerVisibleFor = 0;
// Switch blinker visibility
this.blinkerVisible = !this.blinkerVisible;
}
}
c.fill(this.style.textBoxTextColor);
// Check if text fits
if (this.textFits) {
// If so then draw the whole text to the canvas
c.text(this.#text, this.style.textBoxPadding, this.#textTop);
} else if (this.textClipping == -1) {
// If text doesn't fit but first line fits
// Then draw the first line
c.text(this.lines[0], this.style.textBoxPadding, this.#textTop);
} else {
// If text doesn't fit and 1st line doesn't fit
// Draw first line until the char that doesn't fit
c.text(this.lines[0].substring(0, this.textClipping), this.style.textBoxPadding, this.#textTop);
}
c.pop();