summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Wicki <gandro@gmx.net>2020-11-14 20:39:26 +0100
committerDamien George <damien@micropython.org>2021-11-17 14:36:33 +1100
commit8f3510799d9ad5c2c19189a7a1dd1051d0d46c30 (patch)
tree650a79909cd11f2ca1ad15c731f86241958ef058
parent95ccd9a005c09c58d7a74af97e990c798cb5c4f7 (diff)
docs/library/framebuf.rst: Adjust dimensions in example.
This commit swaps the dimensions of the `framebuffer.FrameBuffer` in the docs example from 10x100 to 100x10 pixels to avoid clipping. This is done to better fit the subsequent example code, which writes text of size 96x8 followed by a 96x1 horizontal line. The y coordinate of the horizontal line is also adjusted such that it is drawn inside of the new canvas bounds.
-rw-r--r--docs/library/framebuf.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/library/framebuf.rst b/docs/library/framebuf.rst
index 13502cc7a..098ada815 100644
--- a/docs/library/framebuf.rst
+++ b/docs/library/framebuf.rst
@@ -19,11 +19,11 @@ For example::
import framebuf
# FrameBuffer needs 2 bytes for every RGB565 pixel
- fbuf = framebuf.FrameBuffer(bytearray(10 * 100 * 2), 10, 100, framebuf.RGB565)
+ fbuf = framebuf.FrameBuffer(bytearray(100 * 10 * 2), 100, 10, framebuf.RGB565)
fbuf.fill(0)
fbuf.text('MicroPython!', 0, 0, 0xffff)
- fbuf.hline(0, 10, 96, 0xffff)
+ fbuf.hline(0, 9, 96, 0xffff)
Constructors
------------