[PR #334] [CLOSED] Sets flex size to 0 when all items have proportion 0. Fixes: #332 #911

Closed
opened 2026-03-04 01:08:31 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rivo/tview/pull/334
Author: @natemago
Created: 8/19/2019
Status: Closed

Base: masterHead: integer-divide-by-zero-error


📝 Commits (1)

  • 497523f Sets flex size to 0 when all items have proportion 0. Fixes: #332

📊 Changes

1 file changed (+9 additions, -1 deletions)

View changed files

📝 flex.go (+9 -1)

📄 Description

In the rare case when all items have proportion 0, then the size of the
flex is also zero.

I've added a check for proprtionSum to be greater than zero to avoid the cases when the sum is zero and a division error is raised.

This fixes #332.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rivo/tview/pull/334 **Author:** [@natemago](https://github.com/natemago) **Created:** 8/19/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `integer-divide-by-zero-error` --- ### 📝 Commits (1) - [`497523f`](https://github.com/rivo/tview/commit/497523fb9b6731e57e7eec88362f570caa5830bf) Sets flex size to 0 when all items have proportion 0. Fixes: #332 ### 📊 Changes **1 file changed** (+9 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `flex.go` (+9 -1) </details> ### 📄 Description In the rare case when all items have proportion 0, then the size of the flex is also zero. I've added a check for `proprtionSum` to be greater than zero to avoid the cases when the sum is zero and a division error is raised. This fixes #332. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:08:31 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#911
No description provided.