Skip to content

Commit 1fa7df1

Browse files
committed
fixing overflow plot limits
1 parent 803f933 commit 1fa7df1

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

.readthedocs.yaml

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
22
#
33
# SPDX-License-Identifier: Unlicense
44

5-
# Read the Docs configuration file
6-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
7-
8-
# Required
95
version: 2
106

117
build:
12-
os: ubuntu-20.04
8+
os: ubuntu-22.04
139
tools:
1410
python: "3"
1511

1612
python:
1713
install:
1814
- requirements: docs/requirements.txt
19-
- requirements: requirements.txt
15+
- requirements: requirements.txt

circuitpython_uplot/uplot.py

+15-11
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ def __init__(
102102

103103
self.padding = padding
104104
self._newxmin = padding
105-
self._newxmax = width - padding
105+
self._newxmax = width - padding - 1
106106

107-
self._newymin = height - padding
107+
self._newymin = height - padding - 1
108108
self._newymax = padding
109109

110110
self._cartesianfirst = True
@@ -127,7 +127,7 @@ def __init__(
127127

128128
self._index_colorused = 4
129129

130-
self._plotbitmap = displayio.Bitmap(width, height, 17)
130+
self._plotbitmap = displayio.Bitmap(width, height, 20)
131131

132132
if show_box:
133133
self._drawbox()
@@ -186,40 +186,44 @@ def _drawbox(self) -> None:
186186
else:
187187
draw_box = [True, True, True, True]
188188

189+
# left y axes line
189190
if draw_box[0]:
190191
# y axes line
191192
draw_line(
192193
self._plotbitmap,
193194
self.padding,
194195
self.padding,
195196
self.padding,
196-
self._height - self.padding,
197+
self._height - self.padding - 1,
197198
1,
198199
)
200+
# bottom x axes line
199201
if draw_box[1]:
200202
draw_line(
201203
self._plotbitmap,
202204
self.padding,
203-
self._height - self.padding,
204-
self._width - self.padding,
205-
self._height - self.padding,
205+
self._height - self.padding - 1,
206+
self._width - self.padding - 1,
207+
self._height - self.padding - 1,
206208
1,
207209
)
210+
# right y axes line
208211
if draw_box[2]:
209212
draw_line(
210213
self._plotbitmap,
211-
self._width - self.padding,
214+
self._width - self.padding - 1,
212215
self.padding,
213-
self._width - self.padding,
214-
self._height - self.padding,
216+
self._width - self.padding - 1,
217+
self._height - self.padding - 1,
215218
1,
216219
)
220+
# top x axes line
217221
if draw_box[3]:
218222
draw_line(
219223
self._plotbitmap,
220224
self.padding,
221225
self.padding,
222-
self._width - self.padding,
226+
self._width - self.padding - 1,
223227
self.padding,
224228
1,
225229
)

optional_requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
22
#
33
# SPDX-License-Identifier: Unlicense

0 commit comments

Comments
 (0)