adafruit-circuitpython-displayio-layout 2.2.0__tar.gz → 2.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- adafruit_circuitpython_displayio_layout-2.2.2/.gitattributes +11 -0
- adafruit_circuitpython_displayio_layout-2.2.2/.pre-commit-config.yaml +21 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/.readthedocs.yaml +3 -0
- {adafruit_circuitpython_displayio_layout-2.2.0/adafruit_circuitpython_displayio_layout.egg-info → adafruit_circuitpython_displayio_layout-2.2.2}/PKG-INFO +5 -5
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/README.rst +3 -3
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2/adafruit_circuitpython_displayio_layout.egg-info}/PKG-INFO +5 -5
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_circuitpython_displayio_layout.egg-info/SOURCES.txt +2 -1
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/layouts/grid_layout.py +9 -22
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/layouts/linear_layout.py +4 -11
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/layouts/page_layout.py +12 -20
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/layouts/tab_layout.py +14 -22
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/widgets/cartesian.py +25 -76
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/widgets/control.py +1 -3
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/widgets/easing.py +3 -5
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/widgets/flip_input.py +55 -117
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/widgets/icon_animated.py +14 -17
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/widgets/icon_widget.py +6 -11
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/widgets/switch_round.py +12 -29
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/widgets/widget.py +1 -3
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/api.rst +3 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/conf.py +2 -6
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_cartesian_advanced_test.py +1 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_cartesian_lineplot.py +2 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_cartesian_simpletest.py +2 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_flip_input_simpletest.py +5 -5
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_grid_layout_get_cell_test.py +4 -6
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_gridlayout_dividers.py +4 -6
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_gridlayout_pygame_display_simpletest.py +3 -7
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_gridlayout_simpletest.py +4 -6
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_icon_animated_simpletest.py +5 -4
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_linearlayout_simpletest.py +3 -3
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_page_layout_advancedtest.py +10 -7
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_page_layout_simpletest.py +6 -3
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_pygame_display_switch_round.py +2 -1
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_simpletest.py +4 -6
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_switch_multiple.py +3 -1
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_switch_simpletest.py +3 -1
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_tab_layout_simpletest.py +10 -7
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/displayio_layout_tab_layout_touchtest.py +6 -4
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/hotplug_sensor_examples/displayio_layout_hotplug_rtc.py +24 -38
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/hotplug_sensor_examples/displayio_layout_hotplug_temp_sensor.py +25 -49
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/pyproject.toml +1 -1
- adafruit_circuitpython_displayio_layout-2.2.2/ruff.toml +101 -0
- adafruit_circuitpython_displayio_layout-2.2.0/.pre-commit-config.yaml +0 -42
- adafruit_circuitpython_displayio_layout-2.2.0/.pylintrc +0 -399
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/.github/workflows/build.yml +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/.github/workflows/failure-help-text.yml +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/.github/workflows/release_gh.yml +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/.github/workflows/release_pypi.yml +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/.gitignore +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/CODE_OF_CONDUCT.md +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/LICENSE +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/LICENSES/CC-BY-4.0.txt +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/LICENSES/MIT.txt +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/LICENSES/OFL-1.1.txt +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/LICENSES/Unlicense.txt +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/README.rst.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_circuitpython_displayio_layout.egg-info/dependency_links.txt +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_circuitpython_displayio_layout.egg-info/requires.txt +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_circuitpython_displayio_layout.egg-info/top_level.txt +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/__init__.py +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/layouts/__init__.py +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/adafruit_displayio_layout/widgets/__init__.py +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/_static/favicon.ico +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/_static/favicon.ico.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/api.rst.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/cartesian.gif +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/cartesian.gif.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/cartesian_explanation.png +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/cartesian_explanation.png.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/cartesian_zones.png +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/cartesian_zones.png.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/examples.rst +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/examples.rst.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/gui_layout_coordinates.png +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/gui_layout_coordinates.png.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/index.rst +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/index.rst.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/docs/requirements.txt +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/bmps/active_tab_sprite.bmp +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/bmps/active_tab_sprite.bmp.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/bmps/inactive_tab_sprite.bmp +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/bmps/inactive_tab_sprite.bmp.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/fonts/Arial-16.bdf +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/fonts/Arial-16.bdf.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/fonts/DSEG14Classic-Regular-64-ModS.pcf +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/fonts/DSEG14Classic-Regular-64-ModS.pcf.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/hotplug_sensor_examples/images/BGimage4.bmp +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/hotplug_sensor_examples/images/BGimage4.bmp.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/icons/Play_48x48_small.bmp +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/examples/icons/Play_48x48_small.bmp.license +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/optional_requirements.txt +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/requirements.txt +0 -0
- {adafruit_circuitpython_displayio_layout-2.2.0 → adafruit_circuitpython_displayio_layout-2.2.2}/setup.cfg +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Unlicense
|
|
4
|
+
|
|
5
|
+
repos:
|
|
6
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
7
|
+
rev: v4.5.0
|
|
8
|
+
hooks:
|
|
9
|
+
- id: check-yaml
|
|
10
|
+
- id: end-of-file-fixer
|
|
11
|
+
- id: trailing-whitespace
|
|
12
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
13
|
+
rev: v0.3.4
|
|
14
|
+
hooks:
|
|
15
|
+
- id: ruff-format
|
|
16
|
+
- id: ruff
|
|
17
|
+
args: ["--fix"]
|
|
18
|
+
- repo: https://github.com/fsfe/reuse-tool
|
|
19
|
+
rev: v3.0.1
|
|
20
|
+
hooks:
|
|
21
|
+
- id: reuse
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: adafruit-circuitpython-displayio-layout
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: CircuitPython helper library for displayio layouts and widgets.
|
|
5
5
|
Author-email: Adafruit Industries <circuitpython@adafruit.com>
|
|
6
6
|
License: MIT
|
|
@@ -37,9 +37,9 @@ Introduction
|
|
|
37
37
|
:target: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/actions
|
|
38
38
|
:alt: Build Status
|
|
39
39
|
|
|
40
|
-
.. image:: https://img.shields.io/badge/
|
|
41
|
-
:target: https://github.com/
|
|
42
|
-
:alt: Code Style:
|
|
40
|
+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
41
|
+
:target: https://github.com/astral-sh/ruff
|
|
42
|
+
:alt: Code Style: Ruff
|
|
43
43
|
|
|
44
44
|
CircuitPython helper library for displayio layouts and widgets.
|
|
45
45
|
|
|
@@ -13,9 +13,9 @@ Introduction
|
|
|
13
13
|
:target: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/actions
|
|
14
14
|
:alt: Build Status
|
|
15
15
|
|
|
16
|
-
.. image:: https://img.shields.io/badge/
|
|
17
|
-
:target: https://github.com/
|
|
18
|
-
:alt: Code Style:
|
|
16
|
+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
17
|
+
:target: https://github.com/astral-sh/ruff
|
|
18
|
+
:alt: Code Style: Ruff
|
|
19
19
|
|
|
20
20
|
CircuitPython helper library for displayio layouts and widgets.
|
|
21
21
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: adafruit-circuitpython-displayio-layout
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: CircuitPython helper library for displayio layouts and widgets.
|
|
5
5
|
Author-email: Adafruit Industries <circuitpython@adafruit.com>
|
|
6
6
|
License: MIT
|
|
@@ -37,9 +37,9 @@ Introduction
|
|
|
37
37
|
:target: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout/actions
|
|
38
38
|
:alt: Build Status
|
|
39
39
|
|
|
40
|
-
.. image:: https://img.shields.io/badge/
|
|
41
|
-
:target: https://github.com/
|
|
42
|
-
:alt: Code Style:
|
|
40
|
+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
41
|
+
:target: https://github.com/astral-sh/ruff
|
|
42
|
+
:alt: Code Style: Ruff
|
|
43
43
|
|
|
44
44
|
CircuitPython helper library for displayio layouts and widgets.
|
|
45
45
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
.gitattributes
|
|
1
2
|
.gitignore
|
|
2
3
|
.pre-commit-config.yaml
|
|
3
|
-
.pylintrc
|
|
4
4
|
.readthedocs.yaml
|
|
5
5
|
CODE_OF_CONDUCT.md
|
|
6
6
|
LICENSE
|
|
@@ -9,6 +9,7 @@ README.rst.license
|
|
|
9
9
|
optional_requirements.txt
|
|
10
10
|
pyproject.toml
|
|
11
11
|
requirements.txt
|
|
12
|
+
ruff.toml
|
|
12
13
|
.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md
|
|
13
14
|
.github/workflows/build.yml
|
|
14
15
|
.github/workflows/failure-help-text.yml
|
|
@@ -22,6 +22,7 @@ Implementation Notes
|
|
|
22
22
|
https://github.com/adafruit/circuitpython/releases
|
|
23
23
|
|
|
24
24
|
"""
|
|
25
|
+
|
|
25
26
|
try:
|
|
26
27
|
# Used only for typing
|
|
27
28
|
from typing import Any, List, Optional, Tuple, Union
|
|
@@ -29,10 +30,11 @@ except ImportError:
|
|
|
29
30
|
pass
|
|
30
31
|
|
|
31
32
|
import math
|
|
33
|
+
|
|
32
34
|
import displayio
|
|
33
35
|
from vectorio import Rectangle
|
|
34
36
|
|
|
35
|
-
__version__ = "2.2.
|
|
37
|
+
__version__ = "2.2.2"
|
|
36
38
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout.git"
|
|
37
39
|
|
|
38
40
|
|
|
@@ -58,8 +60,6 @@ class GridLayout(displayio.Group):
|
|
|
58
60
|
|
|
59
61
|
"""
|
|
60
62
|
|
|
61
|
-
# pylint: disable=too-many-arguments
|
|
62
|
-
# pylint: disable=too-many-instance-attributes
|
|
63
63
|
def __init__(
|
|
64
64
|
self,
|
|
65
65
|
x: int,
|
|
@@ -106,9 +106,7 @@ class GridLayout(displayio.Group):
|
|
|
106
106
|
self.v_divider_line_cols.append(_x)
|
|
107
107
|
|
|
108
108
|
# use at least 1 padding so that content is inside the divider lines
|
|
109
|
-
if cell_padding == 0 and (
|
|
110
|
-
divider_lines or h_divider_line_rows or v_divider_line_cols
|
|
111
|
-
):
|
|
109
|
+
if cell_padding == 0 and (divider_lines or h_divider_line_rows or v_divider_line_cols):
|
|
112
110
|
self.cell_padding = 1
|
|
113
111
|
|
|
114
112
|
def layout_cells(self):
|
|
@@ -116,7 +114,6 @@ class GridLayout(displayio.Group):
|
|
|
116
114
|
self._layout_cells()
|
|
117
115
|
|
|
118
116
|
def _layout_cells(self) -> None:
|
|
119
|
-
# pylint: disable=too-many-locals, too-many-branches, too-many-statements
|
|
120
117
|
for line_obj in self._divider_lines:
|
|
121
118
|
self.remove(line_obj["rect"])
|
|
122
119
|
for cell in self._cell_content_list:
|
|
@@ -310,11 +307,8 @@ class GridLayout(displayio.Group):
|
|
|
310
307
|
areas larger than 1x1 cells. For 1x1 cells this will equal zero
|
|
311
308
|
and not change anything.
|
|
312
309
|
"""
|
|
313
|
-
if (
|
|
314
|
-
grid_position_y + content_cell_size_y - 1
|
|
315
|
-
) == grid_size_y - 1 and (
|
|
316
|
-
(grid_position_y + content_cell_size_y - 1) + 1
|
|
317
|
-
in self.h_divider_line_rows
|
|
310
|
+
if (grid_position_y + content_cell_size_y - 1) == grid_size_y - 1 and (
|
|
311
|
+
(grid_position_y + content_cell_size_y - 1) + 1 in self.h_divider_line_rows
|
|
318
312
|
):
|
|
319
313
|
self._divider_lines.append(
|
|
320
314
|
{
|
|
@@ -350,11 +344,8 @@ class GridLayout(displayio.Group):
|
|
|
350
344
|
areas larger than 1x1 cells. For 1x1 cells this will equal zero
|
|
351
345
|
and not change anything.
|
|
352
346
|
"""
|
|
353
|
-
if (
|
|
354
|
-
grid_position_x + content_cell_size_x - 1
|
|
355
|
-
) == grid_size_x - 1 and (
|
|
356
|
-
(grid_position_x + content_cell_size_x - 1) + 1
|
|
357
|
-
in self.v_divider_line_cols
|
|
347
|
+
if (grid_position_x + content_cell_size_x - 1) == grid_size_x - 1 and (
|
|
348
|
+
(grid_position_x + content_cell_size_x - 1) + 1 in self.v_divider_line_cols
|
|
358
349
|
):
|
|
359
350
|
self._divider_lines.append(
|
|
360
351
|
{
|
|
@@ -426,11 +417,7 @@ class GridLayout(displayio.Group):
|
|
|
426
417
|
):
|
|
427
418
|
return self._cell_content_list[index]["content"]
|
|
428
419
|
|
|
429
|
-
raise KeyError(
|
|
430
|
-
"GridLayout does not contain cell at coordinates {}".format(
|
|
431
|
-
cell_coordinates
|
|
432
|
-
)
|
|
433
|
-
)
|
|
420
|
+
raise KeyError(f"GridLayout does not contain cell at coordinates {cell_coordinates}")
|
|
434
421
|
|
|
435
422
|
@property
|
|
436
423
|
def cell_size_pixels(self) -> Tuple[int, int]:
|
|
@@ -54,7 +54,7 @@ class LinearLayout(Widget):
|
|
|
54
54
|
self.x = x
|
|
55
55
|
self.y = y
|
|
56
56
|
self.padding = padding
|
|
57
|
-
if orientation not in
|
|
57
|
+
if orientation not in {self.VERTICAL_ORIENTATION, self.HORIZONTAL_ORIENTATION}:
|
|
58
58
|
raise ValueError(
|
|
59
59
|
"Orientation must be either LinearLayout.VERTICAL_ORIENTATION"
|
|
60
60
|
" or LinearLayout.HORIZONTAL_ORIENTATION"
|
|
@@ -77,7 +77,6 @@ class LinearLayout(Widget):
|
|
|
77
77
|
self._layout()
|
|
78
78
|
|
|
79
79
|
def _layout(self):
|
|
80
|
-
# pylint: disable=too-many-branches, protected-access
|
|
81
80
|
self._prev_content_end = 0
|
|
82
81
|
|
|
83
82
|
for _, content in enumerate(self._content_list):
|
|
@@ -100,14 +99,10 @@ class LinearLayout(Widget):
|
|
|
100
99
|
else:
|
|
101
100
|
content.x = self._prev_content_end
|
|
102
101
|
if not hasattr(content, "tile_width"):
|
|
103
|
-
self._prev_content_end = (
|
|
104
|
-
content.x + content.width + (self.padding * 2)
|
|
105
|
-
)
|
|
102
|
+
self._prev_content_end = content.x + content.width + (self.padding * 2)
|
|
106
103
|
else:
|
|
107
104
|
self._prev_content_end = (
|
|
108
|
-
content.x
|
|
109
|
-
+ (content.width * content.tile_width)
|
|
110
|
-
+ (self.padding * 2)
|
|
105
|
+
content.x + (content.width * content.tile_width) + (self.padding * 2)
|
|
111
106
|
)
|
|
112
107
|
else: # use anchor point
|
|
113
108
|
content.anchor_point = (
|
|
@@ -130,9 +125,7 @@ class LinearLayout(Widget):
|
|
|
130
125
|
|
|
131
126
|
else:
|
|
132
127
|
original_achored_pos_y = (
|
|
133
|
-
content.anchored_position[1]
|
|
134
|
-
if content.anchored_position is not None
|
|
135
|
-
else 0
|
|
128
|
+
content.anchored_position[1] if content.anchored_position is not None else 0
|
|
136
129
|
)
|
|
137
130
|
|
|
138
131
|
content.anchored_position = (
|
|
@@ -22,9 +22,9 @@ Implementation Notes
|
|
|
22
22
|
https://github.com/adafruit/circuitpython/releases
|
|
23
23
|
|
|
24
24
|
"""
|
|
25
|
+
|
|
25
26
|
try:
|
|
26
27
|
# Used only for typing
|
|
27
|
-
# pylint: disable=unused-import
|
|
28
28
|
from typing import Tuple
|
|
29
29
|
|
|
30
30
|
except ImportError:
|
|
@@ -32,7 +32,7 @@ except ImportError:
|
|
|
32
32
|
|
|
33
33
|
import displayio
|
|
34
34
|
|
|
35
|
-
__version__ = "2.2.
|
|
35
|
+
__version__ = "2.2.2"
|
|
36
36
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout.git"
|
|
37
37
|
|
|
38
38
|
|
|
@@ -90,16 +90,12 @@ class PageLayout(displayio.Group):
|
|
|
90
90
|
raise AttributeError("Must pass either page_name or page_index")
|
|
91
91
|
|
|
92
92
|
if page_index is not None and page_name is not None:
|
|
93
|
-
raise AttributeError(
|
|
94
|
-
"Must pass either page_name or page_index only one or the other"
|
|
95
|
-
)
|
|
93
|
+
raise AttributeError("Must pass either page_name or page_index only one or the other")
|
|
96
94
|
|
|
97
95
|
if page_index is not None:
|
|
98
96
|
if page_index >= len(self.page_content_list):
|
|
99
97
|
raise KeyError(
|
|
100
|
-
"KeyError at index {} in list length {}"
|
|
101
|
-
page_index, len(self.page_content_list)
|
|
102
|
-
),
|
|
98
|
+
f"KeyError at index {page_index} in list length {len(self.page_content_list)}",
|
|
103
99
|
)
|
|
104
100
|
|
|
105
101
|
if page_name is not None:
|
|
@@ -110,7 +106,7 @@ class PageLayout(displayio.Group):
|
|
|
110
106
|
_found = True
|
|
111
107
|
|
|
112
108
|
if not _found:
|
|
113
|
-
raise KeyError("Page with name {} not found"
|
|
109
|
+
raise KeyError(f"Page with name {page_name} not found")
|
|
114
110
|
|
|
115
111
|
def get_page(self, page_name=None, page_index=None):
|
|
116
112
|
"""
|
|
@@ -133,9 +129,7 @@ class PageLayout(displayio.Group):
|
|
|
133
129
|
return cell
|
|
134
130
|
|
|
135
131
|
raise KeyError(
|
|
136
|
-
"PageLayout does not contain page: {}"
|
|
137
|
-
page_index if page_index else page_name
|
|
138
|
-
)
|
|
132
|
+
f"PageLayout does not contain page: {page_index if page_index else page_name}"
|
|
139
133
|
)
|
|
140
134
|
|
|
141
135
|
def show_page(self, page_name=None, page_index=None):
|
|
@@ -205,11 +199,10 @@ class PageLayout(displayio.Group):
|
|
|
205
199
|
|
|
206
200
|
if self._cur_showing_index + 1 < len(self.page_content_list):
|
|
207
201
|
self.show_page(page_index=self._cur_showing_index + 1)
|
|
202
|
+
elif not loop:
|
|
203
|
+
print("No more pages")
|
|
208
204
|
else:
|
|
209
|
-
|
|
210
|
-
print("No more pages")
|
|
211
|
-
else:
|
|
212
|
-
self.show_page(page_index=0)
|
|
205
|
+
self.show_page(page_index=0)
|
|
213
206
|
|
|
214
207
|
def previous_page(self, loop=True):
|
|
215
208
|
"""
|
|
@@ -219,8 +212,7 @@ class PageLayout(displayio.Group):
|
|
|
219
212
|
"""
|
|
220
213
|
if self._cur_showing_index - 1 >= 0:
|
|
221
214
|
self.show_page(page_index=self._cur_showing_index - 1)
|
|
215
|
+
elif not loop:
|
|
216
|
+
print("No more pages")
|
|
222
217
|
else:
|
|
223
|
-
|
|
224
|
-
print("No more pages")
|
|
225
|
-
else:
|
|
226
|
-
self.show_page(page_index=len(self.page_content_list) - 1)
|
|
218
|
+
self.show_page(page_index=len(self.page_content_list) - 1)
|
|
@@ -22,22 +22,25 @@ Implementation Notes
|
|
|
22
22
|
https://github.com/adafruit/circuitpython/releases
|
|
23
23
|
|
|
24
24
|
"""
|
|
25
|
+
|
|
25
26
|
try:
|
|
26
|
-
from typing import Optional,
|
|
27
|
-
|
|
27
|
+
from typing import Optional, Tuple, Union
|
|
28
|
+
|
|
28
29
|
from adafruit_bitmap_font.bdf import BDF
|
|
29
30
|
from adafruit_bitmap_font.pcf import PCF
|
|
31
|
+
from fontio import BuiltinFont
|
|
30
32
|
except ImportError:
|
|
31
33
|
pass
|
|
32
34
|
|
|
33
|
-
import terminalio
|
|
34
|
-
import displayio
|
|
35
35
|
import adafruit_imageload
|
|
36
|
+
import displayio
|
|
37
|
+
import terminalio
|
|
36
38
|
from adafruit_display_text.bitmap_label import Label
|
|
37
39
|
from adafruit_imageload.tilegrid_inflator import inflate_tilegrid
|
|
40
|
+
|
|
38
41
|
from adafruit_displayio_layout.layouts.page_layout import PageLayout
|
|
39
42
|
|
|
40
|
-
__version__ = "2.2.
|
|
43
|
+
__version__ = "2.2.2"
|
|
41
44
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout.git"
|
|
42
45
|
|
|
43
46
|
|
|
@@ -68,8 +71,6 @@ class TabLayout(displayio.Group):
|
|
|
68
71
|
:param int tab_count: How many tabs to draw in the layout. Positive whole numbers are valid.
|
|
69
72
|
"""
|
|
70
73
|
|
|
71
|
-
# pylint: disable=too-many-instance-attributes, too-many-arguments, invalid-name, too-many-branches
|
|
72
|
-
|
|
73
74
|
def __init__(
|
|
74
75
|
self,
|
|
75
76
|
x: int = 0,
|
|
@@ -86,8 +87,7 @@ class TabLayout(displayio.Group):
|
|
|
86
87
|
tab_count: int = None,
|
|
87
88
|
):
|
|
88
89
|
if display is None:
|
|
89
|
-
#
|
|
90
|
-
import board
|
|
90
|
+
import board # noqa: PLC0415, non-top-level-import
|
|
91
91
|
|
|
92
92
|
if hasattr(board, "DISPLAY"):
|
|
93
93
|
display = board.DISPLAY
|
|
@@ -100,9 +100,7 @@ class TabLayout(displayio.Group):
|
|
|
100
100
|
|
|
101
101
|
super().__init__(x=x, y=y)
|
|
102
102
|
self.tab_count = tab_count
|
|
103
|
-
self._active_bmp, self._active_palette = adafruit_imageload.load(
|
|
104
|
-
showing_tab_spritesheet
|
|
105
|
-
)
|
|
103
|
+
self._active_bmp, self._active_palette = adafruit_imageload.load(showing_tab_spritesheet)
|
|
106
104
|
self._inactive_bmp, self._inactive_palette = adafruit_imageload.load(
|
|
107
105
|
inactive_tab_spritesheet
|
|
108
106
|
)
|
|
@@ -121,9 +119,7 @@ class TabLayout(displayio.Group):
|
|
|
121
119
|
for index in inactive_tab_transparent_indexes:
|
|
122
120
|
self._inactive_palette.make_transparent(index)
|
|
123
121
|
else:
|
|
124
|
-
raise AttributeError(
|
|
125
|
-
"inactive_tab_transparent_indexes must be int or tuple"
|
|
126
|
-
)
|
|
122
|
+
raise AttributeError("inactive_tab_transparent_indexes must be int or tuple")
|
|
127
123
|
|
|
128
124
|
self.tab_height = self._active_bmp.height
|
|
129
125
|
self.display = display
|
|
@@ -147,8 +143,7 @@ class TabLayout(displayio.Group):
|
|
|
147
143
|
bmp_obj=self._inactive_bmp,
|
|
148
144
|
bmp_palette=self._inactive_palette,
|
|
149
145
|
target_size=(
|
|
150
|
-
(self.display.width // self.tab_count)
|
|
151
|
-
// (self._active_bmp.width // 3),
|
|
146
|
+
(self.display.width // self.tab_count) // (self._active_bmp.width // 3),
|
|
152
147
|
3,
|
|
153
148
|
),
|
|
154
149
|
)
|
|
@@ -165,8 +160,7 @@ class TabLayout(displayio.Group):
|
|
|
165
160
|
|
|
166
161
|
_tab_label.anchor_point = (0.5, 0.5)
|
|
167
162
|
_tab_label.anchored_position = (
|
|
168
|
-
_tab_tilegrid.x
|
|
169
|
-
+ ((_tab_tilegrid.width * _tab_tilegrid.tile_width) // 2),
|
|
163
|
+
_tab_tilegrid.x + ((_tab_tilegrid.width * _tab_tilegrid.tile_width) // 2),
|
|
170
164
|
(_tab_tilegrid.height * _tab_tilegrid.tile_height) // 2,
|
|
171
165
|
)
|
|
172
166
|
_new_tab_group.append(_tab_label)
|
|
@@ -282,8 +276,6 @@ class TabLayout(displayio.Group):
|
|
|
282
276
|
|
|
283
277
|
if touch_event:
|
|
284
278
|
if 0 <= touch_event[1] <= self.tab_height:
|
|
285
|
-
touched_tab_index = touch_event[0] // (
|
|
286
|
-
self.display.width // self.tab_count
|
|
287
|
-
)
|
|
279
|
+
touched_tab_index = touch_event[0] // (self.display.width // self.tab_count)
|
|
288
280
|
print(f"{touch_event[0]} - {touched_tab_index}")
|
|
289
281
|
self.showing_page_index = touched_tab_index
|
|
@@ -21,13 +21,11 @@ Implementation Notes
|
|
|
21
21
|
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
-
# pylint: disable=too-many-lines, too-many-instance-attributes, too-many-arguments
|
|
25
|
-
# pylint: disable=too-many-locals, too-many-statements
|
|
26
|
-
|
|
27
24
|
import displayio
|
|
28
25
|
import terminalio
|
|
29
|
-
from adafruit_display_text import bitmap_label
|
|
30
26
|
import vectorio
|
|
27
|
+
from adafruit_display_text import bitmap_label
|
|
28
|
+
|
|
31
29
|
from adafruit_displayio_layout.widgets.widget import Widget
|
|
32
30
|
|
|
33
31
|
try:
|
|
@@ -41,7 +39,7 @@ except ImportError:
|
|
|
41
39
|
pass
|
|
42
40
|
|
|
43
41
|
|
|
44
|
-
__version__ = "2.2.
|
|
42
|
+
__version__ = "2.2.2"
|
|
45
43
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout.git"
|
|
46
44
|
|
|
47
45
|
|
|
@@ -229,28 +227,20 @@ class Cartesian(Widget):
|
|
|
229
227
|
self._valuey = self.height / 100
|
|
230
228
|
self._factory = 100 / (self._yrange[1] - self._yrange[0])
|
|
231
229
|
|
|
232
|
-
self._tick_bitmap = displayio.Bitmap(
|
|
233
|
-
self._tick_line_thickness, self._tick_line_height, 3
|
|
234
|
-
)
|
|
230
|
+
self._tick_bitmap = displayio.Bitmap(self._tick_line_thickness, self._tick_line_height, 3)
|
|
235
231
|
self._tick_bitmap.fill(1)
|
|
236
232
|
|
|
237
233
|
self._subticks = subticks
|
|
238
234
|
|
|
239
235
|
axesx_height = (
|
|
240
|
-
2
|
|
241
|
-
+ self._axes_line_thickness
|
|
242
|
-
+ self._font_height
|
|
243
|
-
+ self._tick_line_height // 2
|
|
236
|
+
2 + self._axes_line_thickness + self._font_height + self._tick_line_height // 2
|
|
244
237
|
)
|
|
245
238
|
|
|
246
239
|
self._axesx_bitmap = displayio.Bitmap(self.width, axesx_height, 4)
|
|
247
240
|
self._axesx_bitmap.fill(0)
|
|
248
241
|
|
|
249
242
|
self._axesy_width = (
|
|
250
|
-
2
|
|
251
|
-
+ self._axes_line_thickness
|
|
252
|
-
+ self._font_width
|
|
253
|
-
+ self._tick_line_height // 2
|
|
243
|
+
2 + self._axes_line_thickness + self._font_width + self._tick_line_height // 2
|
|
254
244
|
)
|
|
255
245
|
|
|
256
246
|
self._axesy_bitmap = displayio.Bitmap(self._axesy_width, self.height, 4)
|
|
@@ -408,20 +398,14 @@ class Cartesian(Widget):
|
|
|
408
398
|
self._font,
|
|
409
399
|
color=self._font_color,
|
|
410
400
|
text=text_tick,
|
|
411
|
-
x=-shift_label_x
|
|
412
|
-
- self._axes_line_thickness
|
|
413
|
-
- self._tick_line_height
|
|
414
|
-
- 2,
|
|
401
|
+
x=-shift_label_x - self._axes_line_thickness - self._tick_line_height - 2,
|
|
415
402
|
y=0 + self.height - text_dist,
|
|
416
403
|
)
|
|
417
404
|
self.append(tick_text)
|
|
418
405
|
|
|
419
406
|
bitmaptools.fill_region(
|
|
420
407
|
self._axesy_bitmap,
|
|
421
|
-
self._axesy_width
|
|
422
|
-
- self._axes_line_thickness
|
|
423
|
-
- self._tick_line_height
|
|
424
|
-
- 1,
|
|
408
|
+
self._axesy_width - self._axes_line_thickness - self._tick_line_height - 1,
|
|
425
409
|
text_dist,
|
|
426
410
|
self._axesy_width - self._axes_line_thickness - 1,
|
|
427
411
|
text_dist + self._tick_line_thickness,
|
|
@@ -453,9 +437,7 @@ class Cartesian(Widget):
|
|
|
453
437
|
self.append(self._pointer)
|
|
454
438
|
|
|
455
439
|
def _calc_local_xy(self, x: int, y: int) -> Tuple[int, int]:
|
|
456
|
-
local_x = (
|
|
457
|
-
int((x - self._xrange[0]) * self._factorx * self._valuex) + self._nudge_x
|
|
458
|
-
)
|
|
440
|
+
local_x = int((x - self._xrange[0]) * self._factorx * self._valuex) + self._nudge_x
|
|
459
441
|
# details on `+ (self.height - 1)` :
|
|
460
442
|
# the bitmap is set to self.width & self.height
|
|
461
443
|
# but we are only allowed to draw to pixels 0..height-1 and 0..width-1
|
|
@@ -473,9 +455,7 @@ class Cartesian(Widget):
|
|
|
473
455
|
return 0 <= local_y < self.height
|
|
474
456
|
|
|
475
457
|
def _check_local_xy_in_range(self, local_x: int, local_y: int) -> bool:
|
|
476
|
-
return self._check_local_x_in_range(local_x) and self._check_local_y_in_range(
|
|
477
|
-
local_y
|
|
478
|
-
)
|
|
458
|
+
return self._check_local_x_in_range(local_x) and self._check_local_y_in_range(local_y)
|
|
479
459
|
|
|
480
460
|
def _check_x_in_range(self, x: int) -> bool:
|
|
481
461
|
return self._xrange[0] <= x <= self._xrange[1]
|
|
@@ -498,30 +478,15 @@ class Cartesian(Widget):
|
|
|
498
478
|
if self._verbose:
|
|
499
479
|
print("")
|
|
500
480
|
print(
|
|
501
|
-
"xy: ({: >4}, {: >4}) "
|
|
502
|
-
"_xrange: ({: >4}, {: >4}) "
|
|
503
|
-
"_yrange: ({: >4}, {: >4}) "
|
|
504
|
-
""
|
|
505
|
-
x,
|
|
506
|
-
y,
|
|
507
|
-
self._xrange[0],
|
|
508
|
-
self._xrange[1],
|
|
509
|
-
self._yrange[0],
|
|
510
|
-
self._yrange[1],
|
|
511
|
-
)
|
|
481
|
+
f"xy: ({x: >4}, {y: >4}) "
|
|
482
|
+
+ f"_xrange: ({self._xrange[0]: >4}, {self._xrange[1]: >4}) "
|
|
483
|
+
+ f"_yrange: ({self._yrange[0]: >4}, {self._yrange[1]: >4}) "
|
|
484
|
+
""
|
|
512
485
|
)
|
|
513
486
|
print(
|
|
514
|
-
"local_*: ({: >4}, {: >4}) "
|
|
515
|
-
" width: ({: >4}, {: >4}) "
|
|
516
|
-
" height: ({: >4}, {: >4}) "
|
|
517
|
-
"".format(
|
|
518
|
-
local_x,
|
|
519
|
-
local_y,
|
|
520
|
-
0,
|
|
521
|
-
self.width,
|
|
522
|
-
0,
|
|
523
|
-
self.height,
|
|
524
|
-
)
|
|
487
|
+
f"local_*: ({local_x: >4}, {local_y: >4}) "
|
|
488
|
+
+ f" width: ({0: >4}, {self.width: >4}) "
|
|
489
|
+
+ f" height: ({0: >4}, {self.height: >4}) "
|
|
525
490
|
)
|
|
526
491
|
if self._check_xy_in_range(x, y):
|
|
527
492
|
if self._check_local_xy_in_range(local_x, local_y):
|
|
@@ -536,44 +501,28 @@ class Cartesian(Widget):
|
|
|
536
501
|
if not self._check_local_x_in_range(local_x):
|
|
537
502
|
raise ValueError(
|
|
538
503
|
"local_x out of range: "
|
|
539
|
-
"local_x:{: >4}; _xrange({: >4}, {: >4})"
|
|
540
|
-
""
|
|
541
|
-
local_x,
|
|
542
|
-
0,
|
|
543
|
-
self.width,
|
|
544
|
-
)
|
|
504
|
+
f"local_x:{local_x: >4}; _xrange({0: >4}, {self.width: >4})"
|
|
505
|
+
""
|
|
545
506
|
)
|
|
546
507
|
if not self._check_local_y_in_range(local_y):
|
|
547
508
|
raise ValueError(
|
|
548
509
|
"local_y out of range: "
|
|
549
|
-
"local_y:{: >4}; _yrange({: >4}, {: >4})"
|
|
550
|
-
""
|
|
551
|
-
local_y,
|
|
552
|
-
0,
|
|
553
|
-
self.height,
|
|
554
|
-
)
|
|
510
|
+
f"local_y:{local_y: >4}; _yrange({0: >4}, {self.height: >4})"
|
|
511
|
+
""
|
|
555
512
|
)
|
|
556
513
|
else:
|
|
557
514
|
# for better error messages we check in detail what failed...
|
|
558
515
|
if not self._check_x_in_range(x):
|
|
559
516
|
raise ValueError(
|
|
560
517
|
"x out of range: "
|
|
561
|
-
"x:{: >4}; xrange({: >4}, {: >4})"
|
|
562
|
-
""
|
|
563
|
-
x,
|
|
564
|
-
self._xrange[0],
|
|
565
|
-
self._xrange[1],
|
|
566
|
-
)
|
|
518
|
+
f"x:{x: >4}; xrange({self._xrange[0]: >4}, {self._xrange[1]: >4})"
|
|
519
|
+
""
|
|
567
520
|
)
|
|
568
521
|
if not self._check_y_in_range(y):
|
|
569
522
|
raise ValueError(
|
|
570
523
|
"y out of range: "
|
|
571
|
-
"y:{: >4}; yrange({: >4}, {: >4})"
|
|
572
|
-
""
|
|
573
|
-
y,
|
|
574
|
-
self._yrange[0],
|
|
575
|
-
self._yrange[1],
|
|
576
|
-
)
|
|
524
|
+
f"y:{y: >4}; yrange({self._yrange[0]: >4}, {self._yrange[1]: >4})"
|
|
525
|
+
""
|
|
577
526
|
)
|
|
578
527
|
|
|
579
528
|
def update_pointer(self, x: int, y: int) -> None:
|
|
@@ -27,11 +27,9 @@ except ImportError:
|
|
|
27
27
|
pass
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
__version__ = "2.2.
|
|
30
|
+
__version__ = "2.2.2"
|
|
31
31
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout.git"
|
|
32
32
|
|
|
33
|
-
# pylint: disable=unsubscriptable-object, unnecessary-pass
|
|
34
|
-
|
|
35
33
|
|
|
36
34
|
class Control:
|
|
37
35
|
"""A Control class for responsive elements, including touch response functions for displays.
|
|
@@ -75,8 +75,7 @@ Implementation Notes
|
|
|
75
75
|
|
|
76
76
|
import math
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
__version__ = "2.2.0"
|
|
78
|
+
__version__ = "2.2.2"
|
|
80
79
|
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout.git"
|
|
81
80
|
|
|
82
81
|
|
|
@@ -285,7 +284,7 @@ def exponential_easeinout(pos: float) -> float:
|
|
|
285
284
|
"""
|
|
286
285
|
Easing function for animations: Exponential Ease In & Out
|
|
287
286
|
"""
|
|
288
|
-
if pos in
|
|
287
|
+
if pos in {0.0, 1.0}:
|
|
289
288
|
return pos
|
|
290
289
|
if pos < 0.5:
|
|
291
290
|
return 0.5 * math.pow(2, (20 * pos) - 10)
|
|
@@ -318,8 +317,7 @@ def elastic_easeinout(pos: float) -> float:
|
|
|
318
317
|
if pos < 0.5:
|
|
319
318
|
return 0.5 * math.sin(13 * math.pi * pos) * math.pow(2, 10 * ((2 * pos) - 1))
|
|
320
319
|
return 0.5 * (
|
|
321
|
-
math.sin(-13 * math.pi / 2 * ((2 * pos - 1) + 1)) * pow(2, -10 * (2 * pos - 1))
|
|
322
|
-
+ 2
|
|
320
|
+
math.sin(-13 * math.pi / 2 * ((2 * pos - 1) + 1)) * pow(2, -10 * (2 * pos - 1)) + 2
|
|
323
321
|
)
|
|
324
322
|
|
|
325
323
|
|