taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit e921612d95dea72594ffcf5c97b4737f0b3940ea
parent 05c1eb3cfc350aa04980d934d806760b4c73f1ad
Author: Marc Stibane <marc@taler.net>
Date:   Sat, 21 Sep 2024 15:00:37 +0200

Rectangle height must be > 0

Diffstat:
MTalerWallet1/Views/HelperViews/BarGraph.swift | 18++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/TalerWallet1/Views/HelperViews/BarGraph.swift b/TalerWallet1/Views/HelperViews/BarGraph.swift @@ -83,15 +83,21 @@ struct BarGraph: View { // let _ = print("max: \(maxValue), ", incoming ? "+" : "-", netto) VStack(spacing: 0) { let width = barHeight / 3 - Rectangle() - .opacity(0.001) - .frame(width: width, height: incoming ? valueTransparent : barHeight) + let topHeight = incoming ? valueTransparent : barHeight + let botHeight = incoming ? barHeight : valueTransparent + if topHeight > 0 { + Rectangle() + .opacity(0.001) + .frame(width: width, height: topHeight) + } Rectangle() .foregroundColor(incoming ? .green : .red) .frame(width: width, height: valueColored) - Rectangle() - .opacity(0.001) - .frame(width: width, height: incoming ? barHeight : valueTransparent) + if botHeight > 0 { + Rectangle() + .opacity(0.001) + .frame(width: width, height: botHeight) + } } } }