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

Full sprues create an extra blank page. #246

Closed
blinks opened this issue Jun 14, 2018 · 3 comments
Closed

Full sprues create an extra blank page. #246

blinks opened this issue Jun 14, 2018 · 3 comments
Labels

Comments

@blinks
Copy link
Contributor

blinks commented Jun 14, 2018

Using save_pdf or save_sheet with (completely full) sprues, I end up getting a blank page after all the full pages.

I expect to only get pages with card data.

I believe this is an off-by-one error in /lib/squib/graphics/save_sprue.rb (see below), but I'm not entirely sure how. Note that this is for completely full sprues (I haven't tested for less-than-full).

      def render_sheet(range)
        #...
            cc = next_page_if_needed(cc, i, per_sheet)
        #...
      end

      def next_page_if_needed(cc, i, per_sheet)
        return cc unless (i != 0) && (i % per_sheet).zero?

        draw_overlay_above_cards cc
        cc = draw_page cc
        draw_overlay_below_cards cc
        @page_number += 1
        cc
      end
@andymeneely
Copy link
Owner

Thanks for the report! I'll take a look.

@andymeneely
Copy link
Owner

Turns out it had nothing to do with being off by one. I just randomly had a line in there to draw a new page. Just for funsies.

The fix should appear in v0.14.2 - coming soon

@andymeneely
Copy link
Owner

Welp. This one came back to bite me. Turns out that line there was there for a good reason. Gonna fix the logic for good this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants