mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
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:
@@ -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)");
|
||||
}
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user