Files
ichmagmaus111andClaude Opus 5.5 0622057a4f Ghostgram: open-source release
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:57:09 +01:00

17 lines
820 B
Swift

#if canImport(UIKit)
import UIKit
@testable import RichTextEditorUIKit
extension DocumentCanvasView {
/// Test helper: makes a canvas-DIRECT test behave as if its real parent (`RichTextEditorView`) is
/// present and eagerly re-lays the canvas out whenever it reports a content-size change. Production
/// only NOTIFIES (`notifyContentSizeChanged()` → `onContentSizeChange`); the parent drives
/// `layoutContent()`. Tests that read post-edit geometry (block/emoji/dust views synced in
/// `layoutContent`) call this once after creating the canvas + setting its frame, so an edit flushes
/// layout the way it does at runtime. Install AFTER any initial `layoutIfNeeded()`.
func simulateParentLayout() {
onContentSizeChange = { [weak self] in self?.layoutContent() }
}
}
#endif