Files
babaevmm 956c055cd8 update swiftformat, add organize rule
commit_hash:0f7ba811b37db6d2a9fc05efe5f94502feda4856
2025-08-04 16:24:48 +03:00

43 lines
1.0 KiB
Swift

import Foundation
import LayoutKit
import VGSL
final class DebugBlock: WrapperBlock, LayoutCachingDefaultImpl {
let child: Block
let errorCollector: DebugErrorCollector
let showDebugInfo: (ViewType) -> Void
var debugDescription: String {
"DebugBlock errors: \(errorCollector.debugDescription). Child: \(child)"
}
init(
child: Block,
errorCollector: DebugErrorCollector,
showDebugInfo: @escaping (ViewType) -> Void
) {
self.child = child
self.errorCollector = errorCollector
self.showDebugInfo = showDebugInfo
}
func makeCopy(wrapping block: Block) -> DebugBlock {
DebugBlock(
child: block,
errorCollector: errorCollector,
showDebugInfo: showDebugInfo
)
}
func equals(_ other: any LayoutKit.Block) -> Bool {
if self === other { return true }
guard let other = other as? DebugBlock else { return false }
return errorCollector === other.errorCollector && child.equals(other.child)
}
func getImageHolders() -> [any VGSLUI.ImageHolder] {
child.getImageHolders()
}
}