mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
comments
This commit is contained in:
@@ -314,13 +314,17 @@ class StylesBase(ABC):
|
||||
if self.node is None:
|
||||
return None
|
||||
|
||||
# Check we are animating a Scalar or Scalar offset
|
||||
if isinstance(start_value, (Scalar, ScalarOffset)):
|
||||
|
||||
# If destination is a number, we can convert that to a scalar
|
||||
if isinstance(value, (int, float)):
|
||||
value = Scalar(value, Unit.CELLS, Unit.CELLS)
|
||||
|
||||
# We can only animate to Scalar
|
||||
if not isinstance(value, (Scalar, ScalarOffset)):
|
||||
return None
|
||||
|
||||
return ScalarAnimation(
|
||||
self.node,
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user