Skip to content

Commit daf362d

Browse files
author
Kirk
committed
updated for new rect api sig
1 parent 6aaa30f commit daf362d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/docs/ex_02_lines.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void line_test_vert(void){
132132
}
133133
```
134134
135-
### Rectangles
135+
### Rectangles
136136
137137
Several rectangle routines are shown in this example. A key test is a fast drawing routine which animates a small rectangle being drawn diagonally across the screen.
138138
@@ -146,11 +146,11 @@ The animation algorithm:
146146
for(int i = 0; i < steps; i++){
147147
148148
// Draw the rectangle and send it to device
149-
myOLED.rectangle(x, y, x+side, y+side);
149+
myOLED.rectangle(x, y, side, side);
150150
myOLED.display(); // sends erased rect and new rect pixels to device
151151
152152
// Erase the that rect, increment and loop
153-
myOLED.rectangle(x, y, x+side, y+side, 0);
153+
myOLED.rectangle(x, y, side, side, 0);
154154
155155
x += xinc;
156156
y += yinc;
@@ -166,12 +166,12 @@ Filled rectangles and XOR operations:
166166
```C++
167167
void rect_fill_test(void){
168168

169-
myOLED.rectangleFill(4, 4, width/2-4, height-4);
169+
myOLED.rectangleFill(4, 4, width/2-8, height-8);
170170

171-
myOLED.rectangleFill(width/2+4, 4, width-4, height-4);
171+
myOLED.rectangleFill(width/2+4, 4, width/2-8, height-8);
172172

173-
myOLED.setDrawMode(grROPXOR); // XOR ON
174-
myOLED.rectangleFill(width/4, 8, width - width/4, height-8);
173+
myOLED.setDrawMode(grROPXOR); // xor
174+
myOLED.rectangleFill(width/4, 8, width/2, height-16);
175175
myOLED.setDrawMode(grROPCopy); // back to copy op (default)
176176
}
177177
```

0 commit comments

Comments
 (0)