From af89fe04d5b9a5bad2b7c5b5741357e5b427f437 Mon Sep 17 00:00:00 2001 From: coppro Date: Sun, 20 May 2007 21:28:28 +0000 Subject: [PATCH] Fixed caret size. Made delete card button greyed-out with only one card in set (oops) git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@404 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gui/set/cards_panel.cpp | 2 +- src/util/rotation.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/set/cards_panel.cpp b/src/gui/set/cards_panel.cpp index b185624d..f91681b2 100644 --- a/src/gui/set/cards_panel.cpp +++ b/src/gui/set/cards_panel.cpp @@ -158,7 +158,7 @@ void CardsPanel::onUpdateUI(wxUpdateUIEvent& ev) { ev.Check(ss.card_angle() == a); break; } - case ID_CARD_REMOVE: ev.Enable(set->cards.size() > 0); break; + case ID_CARD_REMOVE: ev.Enable(set->cards.size() > 1); break; case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: { if (focused_control(this) == ID_EDITOR) { ev.Enable(editor->canFormat(ev.GetId())); diff --git a/src/util/rotation.cpp b/src/util/rotation.cpp index 0e4c7e50..9d57e555 100644 --- a/src/util/rotation.cpp +++ b/src/util/rotation.cpp @@ -250,10 +250,18 @@ RealSize RotatedDC::GetTextExtent(const String& text) const { } } double RotatedDC::GetCharHeight() const { + int h = dc.GetCharHeight(); + #ifdef __WXGTK__ + // See above HACK + int extent; + dc.GetTextExtent(_("H"), 0, &extent); + if (h != extent) + h = 2 * extent - h; + #endif if (quality == QUALITY_LOW) { - return dc.GetCharHeight() / zoom; + return h / zoom; } else { - return dc.GetCharHeight() / zoom / text_scaling; + return h / zoom / text_scaling; } }