Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CellView.Size() clips all models to a maximum of 2x2 cells #553

Closed
chrBrd opened this issue Sep 8, 2022 · 0 comments · Fixed by #554
Closed

CellView.Size() clips all models to a maximum of 2x2 cells #553

chrBrd opened this issue Sep 8, 2022 · 0 comments · Fixed by #554

Comments

@chrBrd
Copy link
Contributor

chrBrd commented Sep 8, 2022

According to the comments in this function it's supposed to return a minimum 2x2 square:

// Size returns the content size, based on the model.
func (a *CellView) Size() (int, int) {
	// We always return a minimum of two rows, and two columns.
	w, h := a.model.GetBounds()
	// Clip to a 2x2 minimum square; we can scroll within that.
	if w > 2 {
		w = 2
	}
	if h > 2 {
		h = 2
	}
	return w, h
}

However the comparison operators are incorrect, so it's actually returning a maximum 2x2 square

chrBrd added a commit to chrBrd/tcell that referenced this issue Sep 8, 2022
Fixes gdamore#553

This function is supposed to return a minimum 2x2 square. However, as the comparison operators are the wrong way around a maximum 2x2 square is returned instead. Inverting the comparison operators fixes the issue.
gdamore pushed a commit that referenced this issue Sep 11, 2022
Fixes #553

This function is supposed to return a minimum 2x2 square. However, as the comparison operators are the wrong way around a maximum 2x2 square is returned instead. Inverting the comparison operators fixes the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant