mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Margin space is now not rendered as solid colour
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from textual.geometry import clamp, Offset, Size, Region
|
||||
from textual.geometry import clamp, Offset, Size, Region, Spacing
|
||||
|
||||
|
||||
def test_dimensions_region():
|
||||
@@ -173,6 +173,12 @@ def test_clip():
|
||||
assert Region(10, 10, 20, 30).clip(20, 25) == Region(10, 10, 10, 15)
|
||||
|
||||
|
||||
def test_region_shrink():
|
||||
margin = Spacing(top=1, right=2, bottom=3, left=4)
|
||||
region = Region(x=10, y=10, width=50, height=50)
|
||||
assert region.shrink(margin) == Region(x=14, y=11, width=44, height=46)
|
||||
|
||||
|
||||
def test_region_intersection():
|
||||
assert Region(0, 0, 100, 50).intersection(Region(10, 10, 10, 10)) == Region(
|
||||
10, 10, 10, 10
|
||||
|
||||
Reference in New Issue
Block a user