rotation and style changing works

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@144 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-22 15:08:49 +00:00
parent 5a8febd82a
commit 274cb1117f
14 changed files with 82 additions and 52 deletions
+9
View File
@@ -80,6 +80,14 @@ void ReorderCardsAction::perform(bool to_undo) {
// ----------------------------------------------------------------------------- : Change stylesheet
String DisplayChangeAction::getName(bool to_undo) const {
assert(false);
return _("");
}
void DisplayChangeAction::perform(bool to_undo) {
assert(false);
}
String ChangeCardStyleAction::getName(bool to_undo) const {
return _("Change style");
@@ -88,6 +96,7 @@ void ChangeCardStyleAction::perform(bool to_undo) {
swap(card->stylesheet, stylesheet);
}
String ChangeSetStyleAction::getName(bool to_undo) const {
return _("Change style (all cards)");
}
+9 -2
View File
@@ -76,8 +76,15 @@ class ReorderCardsAction : public CardListAction {
// ----------------------------------------------------------------------------- : Change stylesheet
/// An action that affects the rendering/display/look of a set or cards in the set
class DisplayChangeAction : public Action {
public:
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
};
/// Changing the style of a a card
class ChangeCardStyleAction : public Action {
class ChangeCardStyleAction : public DisplayChangeAction {
public:
ChangeCardStyleAction(const CardP& card, const StyleSheetP& stylesheet)
: card(card), stylesheet(stylesheet) {}
@@ -91,7 +98,7 @@ class ChangeCardStyleAction : public Action {
};
/// Changing the style of a set to that of a card
class ChangeSetStyleAction : public Action {
class ChangeSetStyleAction : public DisplayChangeAction {
public:
ChangeSetStyleAction(Set& set, const CardP& card)
: set(set), card(card) {}
+1 -1
View File
@@ -32,7 +32,7 @@ Bitmap export_bitmap(const SetP& set, const CardP& card) {
// viewer.rotation.angle = 0;
// viewer.rotation.zoom = 1.0;
}
RealSize size = viewer.getRotation().getExternalRect().size();
RealSize size = viewer.getRotation().getExternalSize();
// create bitmap & dc
Bitmap bitmap(size.width, size.height);
if (!bitmap.Ok()) throw InternalError(_("Unable to create bitmap"));