mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Fixed: card box not resized when rotating cards
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@309 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -67,9 +67,9 @@ Rotation DataViewer::getRotation() const {
|
||||
|
||||
// ----------------------------------------------------------------------------- : Setting data
|
||||
|
||||
void DataViewer::setCard(const CardP& card) {
|
||||
void DataViewer::setCard(const CardP& card, bool refresh) {
|
||||
if (!card) return; // TODO: clear viewer?
|
||||
if (this->card == card && this->stylesheet == set->stylesheetFor(card)) return; // already set
|
||||
if (!refresh && this->card == card && this->stylesheet == set->stylesheetFor(card)) return; // already set
|
||||
assert(set);
|
||||
this->card = card;
|
||||
stylesheet = set->stylesheetFor(card);
|
||||
@@ -124,7 +124,7 @@ ValueViewerP DataViewer::makeViewer(const StyleP& style) {
|
||||
void DataViewer::onAction(const Action& action, bool undone) {
|
||||
TYPE_CASE_(action, DisplayChangeAction) {
|
||||
// refresh
|
||||
setCard(card);
|
||||
setCard(card, true);
|
||||
return;
|
||||
}
|
||||
TYPE_CASE(action, ValueAction) {
|
||||
|
||||
@@ -60,7 +60,8 @@ class DataViewer : public SetView {
|
||||
// --------------------------------------------------- : Setting data
|
||||
|
||||
/// Display a card in this viewer
|
||||
void setCard(const CardP& card);
|
||||
/** \param refresh: Always refresh, even if this card is already shown */
|
||||
void setCard(const CardP& card, bool refresh = false);
|
||||
|
||||
// --------------------------------------------------- : The viewers
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user