|
24 | 24 | # pylint: disable=too-many-lines, too-many-instance-attributes, too-many-arguments
|
25 | 25 | # pylint: disable=too-many-locals, too-many-statements
|
26 | 26 |
|
27 |
| -import math |
28 | 27 | import displayio
|
29 | 28 | import board
|
30 | 29 | import terminalio
|
@@ -80,12 +79,13 @@ def __init__(
|
80 | 79 | **kwargs,
|
81 | 80 | ) -> None:
|
82 | 81 | # TODO Make axes, separate from data [X]
|
83 |
| - # TODO Replace with drawline/vectorio [ ] |
| 82 | + # TODO Replace with drawline/vectorio [X] |
84 | 83 | # TODO Make a rectangle function [ ]
|
85 | 84 | # TODO Include functions to equal space ticks [ ]
|
86 | 85 | # TODO Make labels and text [ ]
|
87 | 86 | # TODO Make Styles applicable [ ]
|
88 | 87 | # TODO Animate when overflow [ ]
|
| 88 | + # TODO Add Subticks functionality [ ] |
89 | 89 |
|
90 | 90 | super().__init__(**kwargs, max_size=3)
|
91 | 91 | self._origin_x = x
|
@@ -205,28 +205,19 @@ def _draw_axes(self):
|
205 | 205 |
|
206 | 206 | def _draw_ticks(self):
|
207 | 207 | for i in range(self._margin, self._usable_width, self._tickx_separation):
|
208 |
| - if "rotozoom" in dir(bitmaptools): # if core function is available |
209 |
| - bitmaptools.rotozoom( |
210 |
| - self._screen_bitmap, |
211 |
| - ox=i, |
212 |
| - oy=self._usable_height + self._tick_line_height // 2, |
213 |
| - source_bitmap=self._tick_bitmap, |
214 |
| - px=int(self._tick_bitmap.width), |
215 |
| - py=self._tick_bitmap.height, |
216 |
| - angle=0.0, # in radians |
217 |
| - ) |
| 208 | + bitmaptools.draw_line( |
| 209 | + self._axesx_bitmap, i, self._tick_line_height // 2, i, 0, 2 |
| 210 | + ) |
218 | 211 |
|
219 | 212 | for i in range(self._margin, self._usable_height, self._tickx_separation):
|
220 |
| - if "rotozoom" in dir(bitmaptools): # if core function is available |
221 |
| - bitmaptools.rotozoom( |
222 |
| - self._screen_bitmap, |
223 |
| - ox=0, |
224 |
| - oy=i, |
225 |
| - source_bitmap=self._tick_bitmap, |
226 |
| - px=int(self._tick_bitmap.width), |
227 |
| - py=int(self._tick_bitmap.height / 2), |
228 |
| - angle=(90 * math.pi / 180), # in radians |
229 |
| - ) |
| 213 | + bitmaptools.draw_line( |
| 214 | + self._axesy_bitmap, |
| 215 | + (self._axesy_width - self._tick_line_height // 2) - 1, |
| 216 | + i, |
| 217 | + self._axesy_width - 1, |
| 218 | + i, |
| 219 | + 2, |
| 220 | + ) |
230 | 221 |
|
231 | 222 | def _draw_pointers(self):
|
232 | 223 | self._pointer = vectorio.Circle(3)
|
|
0 commit comments