diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index 3e3b2ddf..d2425464 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -126,7 +126,7 @@ open class TileContainerBase: Control where Padding } /// This controls the aspect ratio for the component. - open var aspectRatio: AspectRatio = .ratio1x1 { didSet { setNeedsUpdate() } } + open var aspectRatio: AspectRatio = .none { didSet { setNeedsUpdate() } } /// Sets the background color for the component. open var color: BackgroundColor? { didSet { setNeedsUpdate() } } @@ -290,7 +290,7 @@ open class TileContainerBase: Control where Padding super.reset() shouldUpdateView = false color = .white - aspectRatio = .ratio1x1 + aspectRatio = .none imageFallbackColor = .light width = nil height = nil diff --git a/VDS/Components/Tilelet/Tilelet.swift b/VDS/Components/Tilelet/Tilelet.swift index 95acf895..0a7178e2 100644 --- a/VDS/Components/Tilelet/Tilelet.swift +++ b/VDS/Components/Tilelet/Tilelet.swift @@ -302,7 +302,6 @@ open class Tilelet: TileContainerBase { /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. open override func setup() { super.setup() - aspectRatio = .none color = .black addContentView(stackView) @@ -386,7 +385,6 @@ open class Tilelet: TileContainerBase { /// Resets to default settings. open override func reset() { shouldUpdateView = false - aspectRatio = .none color = .black //models badgeModel = nil @@ -405,11 +403,7 @@ open class Tilelet: TileContainerBase { updateBadge() updateTitleLockup() updateIcons() - ///Content-driven height Tilelets - Minimum height is configurable. - ///if width != nil && (aspectRatio != .none || height != nil) then tilelet is not self growing, so we can apply text position alignments. - if width != nil && (aspectRatio != .none || height != nil) { - updateTextPositionAlignment() - } + updateTextPositionAlignment() setNeedsLayout() } @@ -584,6 +578,7 @@ open class Tilelet: TileContainerBase { } private func updateTextPositionAlignment() { + guard width != nil && (aspectRatio != .none || height != nil) else { return } switch textPostion { case .top: titleLockupTopConstraint?.activate()