Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## Unreleased

### Added

- Added experimental opt-in support for https://github.com/willmcgugan/textual-speedups

## [3.3.0] - 2025-06-01

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/textual/_compositor.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def reflow(self, parent: Widget, size: Size) -> ReflowResult:
resized_widgets = {
widget
for widget, (region, *_) in changes
if (widget in common_widgets and old_map[widget].region[2:] != region[2:])
if (widget in common_widgets and old_map[widget].region.size != region.size)
}
return ReflowResult(
hidden=hidden_widgets,
Expand Down
8 changes: 8 additions & 0 deletions src/textual/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from __future__ import annotations

import os
from functools import lru_cache
from operator import attrgetter, itemgetter
from typing import (
Expand Down Expand Up @@ -1315,6 +1316,13 @@ def grow_maximum(self, other: Spacing) -> Spacing:
)


if not TYPE_CHECKING and os.environ.get("TEXTUAL_SPEEDUPS") == "1":
try:
from textual_speedups import Offset, Region, Size, Spacing
except ImportError:
pass


NULL_OFFSET: Final = Offset(0, 0)
"""An [offset][textual.geometry.Offset] constant for (0, 0)."""

Expand Down
Loading