* inflect

* diagram

* tooltip render

* tooltip property

* add guard

* tooltip docs

* docs

* tidy, fix horizontal

* words, removed comment

* fix screenshot render

* simplify

* simfplify

* changelog

* simplify optimize

* inflect tests

* Apply suggestions from code review

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* docstring

* disable auto focus

* should be fraction

* optimization

* snapshot update

* Update tests/snapshot_tests/snapshot_apps/scroll_to_center.py

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
This commit is contained in:
Will McGugan
2023-05-30 16:14:31 +01:00
committed by GitHub
parent 83c83de78b
commit 149c39c86c
20 changed files with 478 additions and 102 deletions

View File

@@ -459,3 +459,20 @@ def test_translate_inside():
assert Region(10, 10, 20, 5).translate_inside(Region(0, 0, 100, 100)) == Region(
10, 10, 20, 5
)
def test_inflect():
# Default inflect positive
assert Region(10, 10, 30, 20).inflect(margin=Spacing(2, 2, 2, 2)) == Region(
44, 34, 30, 20
)
# Inflect y axis negative
assert Region(10, 10, 30, 20).inflect(
y_axis=-1, margin=Spacing(2, 2, 2, 2)
) == Region(44, -14, 30, 20)
# Inflect y axis negative
assert Region(10, 10, 30, 20).inflect(
x_axis=-1, margin=Spacing(2, 2, 2, 2)
) == Region(-24, 34, 30, 20)