diff --git a/src/data/format/image.cpp b/src/data/format/image.cpp index 6c0ac01a..67c4222e 100644 --- a/src/data/format/image.cpp +++ b/src/data/format/image.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -19,17 +20,30 @@ void export_image(const SetP& set, const CardP& card, const String& filename) { // but image.saveFile determines it automagicly } +class UnzoomedDataViewer : public DataViewer { + public: + UnzoomedDataViewer(bool use_zoom_settings) + : use_zoom_settings(use_zoom_settings) + {} + virtual Rotation getRotation() const; + private: + bool use_zoom_settings; +}; +Rotation UnzoomedDataViewer::getRotation() const { + if (use_zoom_settings) { + return DataViewer::getRotation(); + } else { + if (!stylesheet) stylesheet = set->stylesheet; + return Rotation(0, stylesheet->getCardRect(), 1.0, 1.0, true); + } +} + Bitmap export_bitmap(const SetP& set, const CardP& card) { // create viewer - DataViewer viewer; + UnzoomedDataViewer viewer(!settings.stylesheetSettingsFor(set->stylesheetFor(card)).card_normal_export()); viewer.setSet(set); viewer.setCard(card); // size of cards - if (settings.stylesheetSettingsFor(set->stylesheetFor(card)).card_normal_export()) { - // TODO -// viewer.rotation.angle = 0; -// viewer.rotation.zoom = 1.0; - } RealSize size = viewer.getRotation().getExternalSize(); // create bitmap & dc Bitmap bitmap((int) size.width, (int) size.height); diff --git a/src/data/symbol_font.cpp b/src/data/symbol_font.cpp index 138048d7..2937f815 100644 --- a/src/data/symbol_font.cpp +++ b/src/data/symbol_font.cpp @@ -217,7 +217,7 @@ next_symbol:; SymbolInFont* SymbolFont::defaultSymbol() const { FOR_EACH_CONST(sym, symbols) { - if (sym->code.empty()) return sym.get(); + if (sym->code.empty() && sym->enabled) return sym.get(); } return nullptr; } diff --git a/src/gui/control/gallery_list.cpp b/src/gui/control/gallery_list.cpp index 84663bd6..75b33c6a 100644 --- a/src/gui/control/gallery_list.cpp +++ b/src/gui/control/gallery_list.cpp @@ -115,6 +115,13 @@ void GalleryList::onChar(wxKeyEvent& ev) { update(); sendEvent(EVENT_GALLERY_SELECT); } break; + case WXK_TAB: { + // send a navigation event to our parent, to select another control + // we need this because tabs are not handled on the set window panels + wxNavigationKeyEvent nev; + nev.SetDirection(!ev.ShiftDown()); + GetParent()->ProcessEvent(nev); + } break; } } diff --git a/src/gui/set/stats_panel.cpp b/src/gui/set/stats_panel.cpp index 75e0efca..88269083 100644 --- a/src/gui/set/stats_panel.cpp +++ b/src/gui/set/stats_panel.cpp @@ -97,7 +97,7 @@ void StatCategoryList::drawItem(DC& dc, int x, int y, size_t item, bool selected // ----------------------------------------------------------------------------- : StatsPanel StatsPanel::StatsPanel(Window* parent, int id) - : SetWindowPanel(parent, id) + : SetWindowPanel(parent, id, true) , up_to_date(true), active(false) { // init controls diff --git a/src/render/card/viewer.cpp b/src/render/card/viewer.cpp index ea8b6a29..51265b13 100644 --- a/src/render/card/viewer.cpp +++ b/src/render/card/viewer.cpp @@ -29,9 +29,8 @@ DataViewer::~DataViewer() {} void DataViewer::draw(DC& dc) { StyleSheetSettings& ss = settings.stylesheetSettingsFor(*stylesheet); - RotatedDC rdc(dc, ss.card_angle(), stylesheet->getCardRect(), ss.card_zoom(), - nativeLook() ? QUALITY_LOW : (ss.card_anti_alias() ? QUALITY_AA : QUALITY_SUB_PIXEL), - true); + RotatedDC rdc(dc, getRotation(), + nativeLook() ? QUALITY_LOW : (ss.card_anti_alias() ? QUALITY_AA : QUALITY_SUB_PIXEL)); draw(rdc, stylesheet->card_background); } void DataViewer::draw(RotatedDC& dc, const Color& background) { @@ -105,7 +104,7 @@ Context& DataViewer::getContext() const { return set->getContext(card); } Rotation DataViewer::getRotation() const { if (!stylesheet) stylesheet = set->stylesheet; StyleSheetSettings& ss = settings.stylesheetSettingsFor(*stylesheet); - return Rotation(ss.card_angle(), stylesheet->getCardRect(), ss.card_zoom(), true); + return Rotation(ss.card_angle(), stylesheet->getCardRect(), ss.card_zoom(), 1.0, true); } // ----------------------------------------------------------------------------- : Setting data diff --git a/src/script/script_manager.cpp b/src/script/script_manager.cpp index 9f8bd1e9..dd81fcc4 100644 --- a/src/script/script_manager.cpp +++ b/src/script/script_manager.cpp @@ -78,7 +78,7 @@ Context& SetScriptContext::getContext(const CardP& card) { ctx.setVariable(_("card"), to_script(card)); ctx.setVariable(_("styling"), to_script(&set.stylingDataFor(card))); } else { - ctx.setVariable(_("card"), ScriptValueP()); + ctx.setVariable(_("card"), script_nil); ctx.setVariable(_("styling"), to_script(&set.stylingDataFor(*stylesheet))); } return ctx;