From 2f83ba747923f96c66464c1f0497d10b03b49889 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sat, 8 Oct 2022 20:20:26 +0800 Subject: [PATCH] CtlCandidateTDK // Remove the trailing divider(). --- .../TDKCandidates/VwrCandidateVertical.swift | 12 ++++++++---- .../VwrCandidateVerticalBackports.swift | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/VwrCandidateVertical.swift b/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/VwrCandidateVertical.swift index 5de70019..6bdee970 100644 --- a/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/VwrCandidateVertical.swift +++ b/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/VwrCandidateVertical.swift @@ -52,7 +52,7 @@ public struct VwrCandidateVertical: View { VStack(alignment: .leading, spacing: 0) { ScrollView(.horizontal, showsIndicators: false) { HStack(alignment: .top, spacing: 10) { - ForEach(thePool.rangeForCurrentPage, id: \.self) { columnIndex in + ForEach(Array(thePool.rangeForCurrentPage.enumerated()), id: \.offset) { loopIndex, columnIndex in VStack(alignment: .leading, spacing: 0) { ForEach(Array(thePool.candidateLines[columnIndex]), id: \.self) { currentCandidate in HStack(spacing: 0) { @@ -69,10 +69,12 @@ public struct VwrCandidateVertical: View { minWidth: Double(CandidateCellData.unifiedSize * 5), alignment: .topLeading ).id(columnIndex) - Divider() + if loopIndex < thePool.maxLinesPerPage - 1 { + Divider() + } } if thePool.maxLinesPerPage - thePool.rangeForCurrentPage.count > 0 { - ForEach(thePool.rangeForLastPageBlanked, id: \.self) { _ in + ForEach(Array(thePool.rangeForLastPageBlanked.enumerated()), id: \.offset) { loopIndex, _ in VStack(alignment: .leading, spacing: 0) { ForEach(0.. 0 { - ForEach(thePool.rangeForLastPageBlanked, id: \.self) { _ in + ForEach(Array(thePool.rangeForLastPageBlanked.enumerated()), id: \.offset) { loopIndex, _ in VStack(alignment: .leading, spacing: 0) { ForEach(0..