This commit is contained in:
Will McGugan
2022-11-12 11:17:25 +00:00
parent 4a1d1565f3
commit 61379cd435

View File

@@ -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,