From dd4ec417ffad5173868b1def3cded70ce3b7ac17 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Mon, 28 Oct 2024 14:19:41 +0000 Subject: [PATCH 1/2] remove __int__ --- src/textual/_resolve.py | 2 +- src/textual/layouts/vertical.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/textual/_resolve.py b/src/textual/_resolve.py index 4c588eefc8..363dfe0958 100644 --- a/src/textual/_resolve.py +++ b/src/textual/_resolve.py @@ -70,7 +70,7 @@ def resolve( fraction_gutter = Fraction(gutter) offsets = [0] + [ - fraction.__int__() + int(fraction) for fraction in accumulate( value for fraction in resolved_fractions diff --git a/src/textual/layouts/vertical.py b/src/textual/layouts/vertical.py index 9ff8336231..307e96ccfc 100644 --- a/src/textual/layouts/vertical.py +++ b/src/textual/layouts/vertical.py @@ -89,9 +89,9 @@ def arrange( _WidgetPlacement( _Region( box_margin.left, - y.__int__(), - content_width.__int__(), - next_y.__int__() - y.__int__(), + int(y), + int(content_width), + int(next_y) - int(y), ), box_margin, widget, From 3170d7a76fb922d5b979135fba0aa1b568f05668 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Mon, 28 Oct 2024 14:24:14 +0000 Subject: [PATCH 2/2] int to floor --- src/textual/_resolve.py | 2 +- src/textual/layouts/vertical.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/textual/_resolve.py b/src/textual/_resolve.py index 363dfe0958..5f7e85ca81 100644 --- a/src/textual/_resolve.py +++ b/src/textual/_resolve.py @@ -70,7 +70,7 @@ def resolve( fraction_gutter = Fraction(gutter) offsets = [0] + [ - int(fraction) + fraction.__floor__() for fraction in accumulate( value for fraction in resolved_fractions diff --git a/src/textual/layouts/vertical.py b/src/textual/layouts/vertical.py index 307e96ccfc..a5bf67aa40 100644 --- a/src/textual/layouts/vertical.py +++ b/src/textual/layouts/vertical.py @@ -89,9 +89,9 @@ def arrange( _WidgetPlacement( _Region( box_margin.left, - int(y), - int(content_width), - int(next_y) - int(y), + y.__floor__(), + content_width.__floor__(), + next_y.__floor__() - y.__floor__(), ), box_margin, widget,