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
Table cell that has multiple rows shows diff cell colors incorrectly #214
Comments
I wonder if this is a bug that was inherited by the upgrade to Prawn Table. I'll investigate to see if I can figure out the origin of the issue. |
I think perhaps your dependencies are out of sync because I'm not seeing this in dev. Could you retest once 1.5.0.alpha.8 is out? |
alpha.8 is out. Can you retest? |
Dan, Working on possibly getting an env you can look at from my end but in the meantime I wanted to tell you what I'm doing on my end see if you can reproduce.
This is what is installed and versions. I figured I'd include this to see if maybe there is some discrepancy in versions that is causing issue on my end that you are not seeing.
|
Thanks @rlopez133!
This tells me that you're not actually using RVM. Can you run the following command and paste the output?
I expect it to say something like:
If instead it says "system", then you're not actually using RVM. |
This also tells me you're not using RVM because bundler comes with RVM preinstalled. |
The best way to reproduce our environments is to use Docker. Perhaps we can use the equivalent version of CentOS instead of RHEL as I don't have RHEL. Here's the CentOS Docker image: |
|
That's good news! I see that the message from bundler is because "As root user" :) It's probably best if you create a user, but I don't think that's going to affect the results, just a general recommendation. |
No argument there. :) |
How are you running asciidoctor-pdf from dev? Are you running it like this?
|
|
You don't need the "ruby" part, but that probably won't affect the results. |
I'm going to attempt this on CentOS 7. It would really help if you pushed the latest theme and sample files to the refarch-asciidoc repository and made sure one of the files in that repository demonstrates the issue. That way, I can clone it from inside Docker and (in theory) get the same results. |
...or create a branch if you need to preserve master. |
OK, let me see what I can do. 👍 |
I misspoke. RVM doesn't come with bundler by default. That's very strange. I thought it did. Okay, so |
I just setup a fresh install on CentOS 7.1 using Docker and my output is exactly the same as the last screenshot I posted. That means that, if there is a difference, it's coming from either your documents or how you are running Asciidoctor PDF. I'll document the steps I used to setup Docker so that you can reproduce. If you follow the exact same steps and still see this problem, then we'll at least have isolated the differences. |
sounds like a plan! Tomorrow I'll update my repo with the theme. As for the whole document, not sure I'll be able to post that yet, but I can definitely maybe just run a specific chapter and see if I can reproduce. I'll update this tomm, when I have some more info. |
Just a snippet out of context is plenty sufficient. We just need the error
to present itself, and know we're on track to reproduce future errors
(hence the effort).
|
Here are the steps I followed to get a test setup for Asciidoctor PDF on CentOS 7.1 using Docker:
What's left is to grab the rh-theme.yml and sample AsciiDoc files from another repo and run them to see if we get the same results. Note that I mounted the /tmp directory inside the Docker container to the host /tmp directory so you have an easy way to pass files back and forth. Alternatively, you could use scp. |
I can duplicate the problem!! Thanks for sticking with me on this one, @rlopez133. I'm now seeing the problem. I haven't yet been able to determine a solution, but at least I have something I can probe. Stay tuned. |
I was right in that it depends on the content somehow. If I put only the table in a document and convert it, it looks fine. When it's in the middle of the document, I'm able to reproduce the bug. |
It happens when the table is inside of a section. Now I need to figure out what a section has to do with the background on a table cell. |
Wow, I feel like kind of a moron now that I've discovered what's going on. In my attempt to optimize the code, I turned off the background color on the table if the color is white and the parent is a section (meaning it's not nested inside a block). (Of course, I forgot about the code if the parent is a document). The reason this was hard to reproduce was because it only manifests when the table is in a certain part of the document. That's why the reproducible test case (or test document) is much more valuable than a screenshot ;) If we can move forward working on sample documents, it's going to save us a ton of time. Now...to fix the issue. |
...the screenshots are still helpful to explain what to look for, but the sample document is essential for debugging. |
We now understand how Prawn shades cells that span rows. It first shades the rows in alternating colors, then it covers over it with the color of the cell spanning those rows. We saw bleed-through because the odd row background color was nil (as a result of the table background color being nil). |
resolves #214 use table background color, even if white
Give master a try now and see if you get the results you expect. I do recommend setting the background color on the table, but you should no longer have to set the background color of the row you want to be white. Btw, here's a shorthand way to set the color of the table background color:
|
Hopefully, we can start moving forward again :) |
The post-mortem of this issue is that the transparent cell background was a bug I caused, but a bug in prawn-table (prawnpdf/prawn-table#45) was throwing me off the scent. I've addressed both situations. |
Just tested it, and confirmed fixed! :) Glad you were able to find this one, it was definitely a pain! lol |
\o/ Sometimes, the programs like to test our commitment :) We're committed! |
When I have a cell that spans multiple rows, its showing diff cell colors for each row. This does not happen in alpha7 but in dev.
Latest alpha output (It should have this behavior).
dev output:
Doesn't really show up well here, but the color used in the alpha for diff colors per row looks better to me than what is now used in dev.
The text was updated successfully, but these errors were encountered: