Skip to content

Commit

Permalink
Merge pull request #441 from square/watt/caffeinated-layout/2
Browse files Browse the repository at this point in the history
2) Refactor ContentStorage into new files
  • Loading branch information
watt authored Mar 20, 2023
2 parents c5a3faa + d9cb10b commit c3ed79c
Show file tree
Hide file tree
Showing 9 changed files with 484 additions and 489 deletions.
18 changes: 18 additions & 0 deletions BlueprintUI/Sources/Element/ContentStorage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import CoreGraphics

/// The implementation of an `ElementContent`.
protocol ContentStorage {
var childCount: Int { get }

func measure(
in constraint: SizeConstraint,
environment: Environment,
cache: CacheTree
) -> CGSize

func performLayout(
attributes: LayoutAttributes,
environment: Environment,
cache: CacheTree
) -> [(identifier: ElementIdentifier, node: LayoutResultNode)]
}
Loading

0 comments on commit c3ed79c

Please sign in to comment.