Skip to content

Commit 23d05f1

Browse files
committed
Indentation fixes
1 parent 8811685 commit 23d05f1

File tree

1 file changed

+72
-72
lines changed

1 file changed

+72
-72
lines changed

MicroView.cpp

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,22 +1472,22 @@ MicroViewSlider::MicroViewSlider(uint8_t newx, uint8_t newy, int16_t min, int16_
14721472
MicroViewSlider::MicroViewSlider(uint8_t newx, uint8_t newy, int16_t min, int16_t max, uint8_t sty):MicroViewWidget(newx, newy, min, max) {
14731473

14741474
switch(sty){
1475-
case WIDGETSTYLE1:
1476-
style=1;
1477-
totalTicks=60;
1478-
break;
1479-
case WIDGETSTYLE2:
1480-
style=2;
1481-
totalTicks=20;
1482-
break;
1483-
case WIDGETSTYLE3:
1484-
style=3;
1485-
totalTicks=40;
1486-
break;
1487-
default:
1488-
style=0;
1489-
totalTicks=30;
1490-
break;
1475+
case WIDGETSTYLE1:
1476+
style=1;
1477+
totalTicks=60;
1478+
break;
1479+
case WIDGETSTYLE2:
1480+
style=2;
1481+
totalTicks=20;
1482+
break;
1483+
case WIDGETSTYLE3:
1484+
style=3;
1485+
totalTicks=40;
1486+
break;
1487+
default:
1488+
style=0;
1489+
totalTicks=30;
1490+
break;
14911491
}
14921492

14931493
prevValue=getMinValue();
@@ -1502,35 +1502,35 @@ MicroViewSlider::MicroViewSlider(uint8_t newx, uint8_t newy, int16_t min, int16_
15021502
*/
15031503
void MicroViewSlider::drawFace() {
15041504
uint8_t offsetX, offsetY, endOffset;
1505-
offsetX=getX();
1506-
offsetY=getY();
1505+
offsetX=getX();
1506+
offsetY=getY();
15071507

15081508
//Horizontal styles, style 0 or 1
1509-
if (style==0 || style==1) {
1510-
endOffset = offsetX + totalTicks + 2;
1509+
if (style==0 || style==1) {
1510+
endOffset = offsetX + totalTicks + 2;
15111511
// Draw minor ticks
1512-
for (uint8_t i=offsetX+1; i<endOffset; i+=2) {
1513-
uView.lineV(i, offsetY+5, 3);
1514-
}
1512+
for (uint8_t i=offsetX+1; i<endOffset; i+=2) {
1513+
uView.lineV(i, offsetY+5, 3);
1514+
}
15151515
// Draw extensions for major ticks
1516-
for (uint8_t i=offsetX+1; i<endOffset; i+=10) {
1517-
uView.lineV(i, offsetY+3, 2);
1516+
for (uint8_t i=offsetX+1; i<endOffset; i+=10) {
1517+
uView.lineV(i, offsetY+3, 2);
1518+
}
15181519
}
1519-
}
15201520
//Vertical styles, style 2 or 3
1521-
else {
1522-
endOffset = offsetY + totalTicks + 2;
1521+
else {
1522+
endOffset = offsetY + totalTicks + 2;
15231523
// Draw minor ticks
1524-
for (uint8_t i=offsetY+1; i<=endOffset; i+=2) {
1525-
uView.lineH(offsetX, i, 3);
1526-
}
1524+
for (uint8_t i=offsetY+1; i<=endOffset; i+=2) {
1525+
uView.lineH(offsetX, i, 3);
1526+
}
15271527
// Draw extensions for major ticks
1528-
for (uint8_t i=offsetY+1; i<=endOffset; i+=10) {
1529-
uView.lineH(offsetX+3, i, 2);
1528+
for (uint8_t i=offsetY+1; i<=endOffset; i+=10) {
1529+
uView.lineH(offsetX+3, i, 2);
1530+
}
15301531
}
1531-
}
15321532

1533-
}
1533+
}
15341534

15351535
/** \brief Draw widget value.
15361536
@@ -1539,8 +1539,8 @@ void MicroViewSlider::drawFace() {
15391539
void MicroViewSlider::draw() {
15401540
uint8_t offsetX, offsetY;
15411541
uint8_t tickPosition=0;
1542-
char strBuffer[7];
1543-
char formatStr[] = "%1d";
1542+
char strBuffer[7];
1543+
char formatStr[] = "%1d";
15441544

15451545
formatStr[1] = '0' + getMaxValLen(); // Set the field width for the value range
15461546

@@ -1561,43 +1561,43 @@ void MicroViewSlider::draw() {
15611561

15621562

15631563
if (needFirstDraw) {
1564-
sprintf(strBuffer, formatStr, prevValue); // print with fixed width so that blank space will cover larger value
1565-
needFirstDraw=false;
1564+
sprintf(strBuffer, formatStr, prevValue); // print with fixed width so that blank space will cover larger value
1565+
needFirstDraw=false;
15661566
}
15671567
else {
1568-
// Draw current pointer
1569-
if (style==0 || style==1){ //Horizontal
1570-
tickPosition = ((float)(uint16_t)(getValue()-getMinValue())/(float)(uint16_t)(getMaxValue()-getMinValue()))*totalTicks;
1571-
uView.lineH(offsetX+tickPosition,offsetY, 3, WHITE, XOR);
1572-
uView.pixel(offsetX+1+tickPosition,offsetY+1, WHITE, XOR);
1573-
}
1574-
else { //Vertical
1575-
tickPosition = ((float)(uint16_t)(getMaxValue()-getValue())/(float)(uint16_t)(getMaxValue()-getMinValue()))*totalTicks;
1576-
uView.lineV(offsetX+7, offsetY+tickPosition, 3, WHITE, XOR);
1577-
uView.pixel(offsetX+6, offsetY+1+tickPosition, WHITE, XOR);
1578-
}
1579-
1580-
sprintf(strBuffer, formatStr, getValue()); // print with fixed width so that blank space will cover larger value
1581-
prevValue=getValue();
1568+
// Draw current pointer
1569+
if (style==0 || style==1){ //Horizontal
1570+
tickPosition = ((float)(uint16_t)(getValue()-getMinValue())/(float)(uint16_t)(getMaxValue()-getMinValue()))*totalTicks;
1571+
uView.lineH(offsetX+tickPosition,offsetY, 3, WHITE, XOR);
1572+
uView.pixel(offsetX+1+tickPosition,offsetY+1, WHITE, XOR);
1573+
}
1574+
else { //Vertical
1575+
tickPosition = ((float)(uint16_t)(getMaxValue()-getValue())/(float)(uint16_t)(getMaxValue()-getMinValue()))*totalTicks;
1576+
uView.lineV(offsetX+7, offsetY+tickPosition, 3, WHITE, XOR);
1577+
uView.pixel(offsetX+6, offsetY+1+tickPosition, WHITE, XOR);
1578+
}
1579+
1580+
sprintf(strBuffer, formatStr, getValue()); // print with fixed width so that blank space will cover larger value
1581+
prevValue=getValue();
15821582
}
15831583

15841584
// Draw value
1585-
switch(style){
1586-
case 0:
1587-
uView.setCursor(offsetX+totalTicks+4, offsetY+1);
1588-
break;
1589-
case 1:
1590-
uView.setCursor(offsetX, offsetY+10);
1591-
break;
1592-
case 2:
1593-
uView.setCursor(offsetX+1, offsetY+totalTicks+4);
1594-
break;
1595-
default:
1596-
uView.setCursor(offsetX+9, offsetY);
1597-
break;
1598-
}
1599-
1600-
uView.print(strBuffer);
1585+
switch(style){
1586+
case 0:
1587+
uView.setCursor(offsetX+totalTicks+4, offsetY+1);
1588+
break;
1589+
case 1:
1590+
uView.setCursor(offsetX, offsetY+10);
1591+
break;
1592+
case 2:
1593+
uView.setCursor(offsetX+1, offsetY+totalTicks+4);
1594+
break;
1595+
default:
1596+
uView.setCursor(offsetX+9, offsetY);
1597+
break;
1598+
}
1599+
1600+
uView.print(strBuffer);
16011601
}
16021602

16031603
// -------------------------------------------------------------------------------------
@@ -1651,7 +1651,7 @@ void MicroViewGauge::drawFace() {
16511651
offsetY=getY();
16521652

16531653
uView.circle(offsetX,offsetY,radius);
1654-
1654+
16551655
for (int i=150;i<=390;i+=30) { // Major tick from 150 degree to 390 degree
16561656
degreeSec=i*(PI/180);
16571657
fromSecX = cos(degreeSec) * (radius / 1.5);
@@ -1715,9 +1715,9 @@ void MicroViewGauge::draw() {
17151715

17161716
// Draw value
17171717
if (style>0)
1718-
uView.setCursor(offsetX-valOffset, offsetY+10);
1718+
uView.setCursor(offsetX-valOffset, offsetY+10);
17191719
else
1720-
uView.setCursor(offsetX-valOffset, offsetY+11);
1720+
uView.setCursor(offsetX-valOffset, offsetY+11);
17211721

17221722
uView.print(strBuffer);
17231723
}

0 commit comments

Comments
 (0)