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

A volume-transition can not be present at the beginning and end of the same page #115

Open
bertfrees opened this issue May 6, 2020 · 1 comment

Comments

@bertfrees
Copy link
Collaborator

For example, a any-resumed will never be rendered at the start of a volume of only one page, because any-interrupted (which may be empty) will always win in that case.

This is clearly very unlikely to happen in a real situation. However it would still be good to support it, or at least notify the user of it with a warning message. In a testing scenario it is not so unlikely that a volume has one page. It happened to me and I spent a lot of time chasing what I thought was a bug somewhere else in the code.

To fix it properly is not so difficult, but there is also a solution in between that is even simpler, namely to let any-resumed win in case of conflicts when any-interrupted is empty. Then you can still not test them together on the same page, but at least you can test one or the other.

@bertfrees
Copy link
Collaborator Author

bertfrees commented May 7, 2020

This was my temporary solution to make my test work:

@@ -333,7 +333,11 @@ public class SheetDataSource implements SplitPointDataSource<Sheet, SheetDataSou
                             }
                         }
                         volumeEnded = transition != null;
-                    } else if (sheetBuffer.size() == 0 && (!sectionProperties.duplex() || pageIndex % 2 == 0)) {
+                    }
+                    if (sheetBuffer.size() == 0 && (!sectionProperties.duplex() || pageIndex % 2 == 0)
+                        && (transition == null || (transition.getInAny().isEmpty()
+                                                   && transition.getInSequence().isEmpty()
+                                                   && transition.getInBlock().isEmpty()))) {
                         transition = context.getTransitionBuilder().getResumeTransition();
                     }
                 }

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

No branches or pull requests

1 participant