new tests
This commit is contained in:
@@ -355,7 +355,7 @@ struct DBSynSchemaDiagramView: View {
|
||||
// previous implementation only saved the checkboxes, leaving the diagram
|
||||
// scrolled to stale positions after None / All / individual selections.
|
||||
private func updateIncludedObjects(_ updated: Set<String>) {
|
||||
let valid = updated.intersection(Set(allObjects))
|
||||
let valid = DiagramLogic.selectedObjects(updated, available: allObjects)
|
||||
guard valid != includedObjects else { return }
|
||||
includedObjects = valid
|
||||
if let selectedObject, !valid.contains(selectedObject) {
|
||||
@@ -371,11 +371,7 @@ struct DBSynSchemaDiagramView: View {
|
||||
|
||||
private func arrange() {
|
||||
let names = allObjects.filter { includedObjects.contains($0) }
|
||||
let countPerRow = max(1, Int(ceil(sqrt(Double(max(1, names.count))))))
|
||||
for (index, name) in names.enumerated() {
|
||||
positions[name] = CGPoint(x: CGFloat(index % countPerRow) * 290 + 30,
|
||||
y: CGFloat(index / countPerRow) * 300 + 30)
|
||||
}
|
||||
positions.merge(DiagramLogic.arrangedPositions(names)) { _, latest in latest }
|
||||
}
|
||||
private func loadCatalog() {
|
||||
let stored = UserDefaults.standard.stringArray(forKey: catalogKey) ?? ["Main"]
|
||||
|
||||
Reference in New Issue
Block a user