Commit a68bb66b authored by twanvl's avatar twanvl

radians, not degrees!

parent 08261b8c
...@@ -127,22 +127,22 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) { ...@@ -127,22 +127,22 @@ void CardsPrintout::drawCard(DC& dc, const CardP& card, int card_nr) {
, job->layout.margin_top + (job->layout.card_size.height + job->layout.card_spacing.height) * row); , job->layout.margin_top + (job->layout.card_size.height + job->layout.card_spacing.height) * row);
// determine rotation // determine rotation
const StyleSheet& stylesheet = job->set->stylesheetFor(card); const StyleSheet& stylesheet = job->set->stylesheetFor(card);
int rotation = 0; Radians rotation = 0;
if ((stylesheet.card_width > stylesheet.card_height) != job->layout.card_landscape) { if ((stylesheet.card_width > stylesheet.card_height) != job->layout.card_landscape) {
rotation = 90 - rotation; rotation = rad90;
} }
/* /*
// size of this particular card (in mm) // size of this particular card (in mm)
RealSize card_size( stylesheet.card_width * 25.4 / stylesheet.card_dpi RealSize card_size( stylesheet.card_width * 25.4 / stylesheet.card_dpi
, stylesheet.card_height * 25.4 / stylesheet.card_dpi); , stylesheet.card_height * 25.4 / stylesheet.card_dpi);
if (rotation == 90) swap(card_size.width, card_size.height); if (is_rad90(rotation)) swap(card_size.width, card_size.height);
// adjust card size, to center card in the available space (from job->layout.card_size)? // adjust card size, to center card in the available space (from job->layout.card_size)?
// TODO: deal with different sized cards in general // TODO: deal with different sized cards in general
*/ */
// create buffers // create buffers
int w = int(stylesheet.card_width), h = int(stylesheet.card_height); // in pixels int w = int(stylesheet.card_width), h = int(stylesheet.card_height); // in pixels
if (rotation == 90) swap(w,h); if (is_rad90(rotation)) swap(w,h);
// Draw using text buffer // Draw using text buffer
double zoom = IsPreview() ? 1 : 4; double zoom = IsPreview() ? 1 : 4;
wxBitmap buffer(w*zoom,h*zoom,32); wxBitmap buffer(w*zoom,h*zoom,32);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment