[go: nahoru, domu]

Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Nov 12, 2022
1 parent 4a1d156 commit 61379cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/textual/css/styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,17 @@ def __textual_animation__(
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,
Expand Down

0 comments on commit 61379cd

Please sign in to comment.