feat: uncouple export zoom from display zoom

This commit is contained in:
Brendan Hagan
2022-06-13 20:24:55 -04:00
parent 94b073f496
commit 6df6aec42d
5 changed files with 58 additions and 17 deletions
+8 -3
View File
@@ -36,18 +36,23 @@ private:
double angle = 0.0;
};
Rotation UnzoomedDataViewer::getRotation() const {
if (use_zoom_settings) {
/*if (use_zoom_settings) {
return DataViewer::getRotation();
} else {
if (!stylesheet) stylesheet = set->stylesheet;
return Rotation(angle, stylesheet->getCardRect(), zoom, 1.0, ROTATION_ATTACH_TOP_LEFT);
}
}*/
if (!stylesheet) stylesheet = set->stylesheet;
int export_zoom = settings.stylesheetSettingsFor(set->stylesheetFor(card)).export_zoom();
return Rotation(angle, stylesheet->getCardRect(), export_zoom, 1.0, ROTATION_ATTACH_TOP_LEFT);
}
Bitmap export_bitmap(const SetP& set, const CardP& card) {
if (!set) throw Error(_("no set"));
// create viewer
UnzoomedDataViewer viewer(!settings.stylesheetSettingsFor(set->stylesheetFor(card)).card_normal_export());
UnzoomedDataViewer viewer(false);
//UnzoomedDataViewer viewer(!settings.stylesheetSettingsFor(set->stylesheetFor(card)).card_normal_export());
viewer.setSet(set);
viewer.setCard(card);
// size of cards