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

Fix Borders in v2 #374

Closed
colearendt opened this issue Nov 28, 2023 · 2 comments
Closed

Fix Borders in v2 #374

colearendt opened this issue Nov 28, 2023 · 2 comments
Labels
invalid This doesn't seem right v2 will be solved in v2

Comments

@colearendt
Copy link

Describe the bug

Border styles are not loaded / presented

To Reproduce

  • build a doc with borders
  • notice that borders do not show up

Related code:

	shadeColor := &props.Color{
		Red:   238,
		Green: 238,
		Blue:  228,
	}

	blackColor := &props.Color{
		Red:   255,
		Green: 255,
		Blue:  255,
	}
	
	m.AddRows(
		row.New(6).Add(
			col.New(2).Add(),
			col.New(2).Add(text.New("Hi", props.Text{Align: "CM"})).WithStyle(&props.Cell{BorderColor: blackColor, BorderThickness: 10, BorderType: border.Full, LineStyle: linestyle.Solid}),
			col.New(3).Add(text.New("Hi", props.Text{Align: "CM"})),
			col.New(3).Add(text.New("Hi", props.Text{Align: "CM"})),
			col.New(2).Add(),
		).WithStyle(&props.Cell{BackgroundColor: shadeColor, BorderColor: blackColor, BorderThickness: 10, BorderType: border.Full, LineStyle: linestyle.Solid}),
	)

Expected behavior
Show borders

Stacktrace
N/A No Errors
Additional details (please complete the following information):

  • OS: MacOS

Additional context

Discussed briefly in #257

@johnfercher
Copy link
Owner

johnfercher commented Nov 28, 2023

Hey, I see the problem here. Your shade color is almost a white and your black color is actually a white. And you are using a huge border thickness of 10.

Try to use these values instead and you will see the issue:

shadeColor := &props.Color{
		Red:   255,
		Green: 0,
		Blue:  0,
	}

	blackColor := &props.Color{
		Red:   0,
		Green: 0,
		Blue:  0,
	}

	colStyle2 := &props.Cell{
		BackgroundColor: shadeColor,
		BorderType:      border.Full,
		BorderColor:     blackColor,
		LineStyle:       linestyle.Solid,
		BorderThickness: 0.5,
	}

@johnfercher johnfercher added invalid This doesn't seem right v2 will be solved in v2 labels Nov 28, 2023
@colearendt
Copy link
Author

Welp. That's a big ol' goof 🤣

Thanks for your patience! It is working fantastic, thanks!

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right v2 will be solved in v2
Projects
None yet
Development

No branches or pull requests

2 participants