fix: Fix improper 'OfType' linq cast
Previously, animations were expressed through polymorphism (derived from the base class CellAnimation), but the new impl uses composition. This 'OfType' call was leftover from the polymorphism implementation, an attempt to linq cast elements of base class (CellAnimation) to BackgroundAnimation.
This commit is contained in:
1 parent
c9a8325713
commit
0b0ff8f502
1 file changed
+1
-2
@@ -70,8 +70,7 @@ namespace mbts.ui.controls {
|
||||
public double border_thickness => _border_thickness.Value;
|
||||
|
||||
void _apply_animation() {
|
||||
var bga = _animations.OfType<BackgroundAnimation>().FirstOrDefault();
|
||||
if (bga != null) {
|
||||
if (_animations.Select(a => a.background_animation).ExceptNull().TryGetFirst(out var bga)) {
|
||||
_background.set(bga.brush);
|
||||
if (bga.pen != null) {
|
||||
_border.set(bga.pen.Brush);
|
||||
|
||||
Reference in new issue
Block a user