mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
Layout() always called when editor/viewer control changes size
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@145 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -58,6 +58,7 @@ ValueViewer* DataViewer::focusedViewer() const { return nullptr; }
|
||||
Context& DataViewer::getContext() const { return set->getContext(); }
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -71,6 +72,7 @@ void DataViewer::setCard(const CardP& card) {
|
||||
stylesheet = set->stylesheetFor(card);
|
||||
setStyles(stylesheet, stylesheet->card_style);
|
||||
setData(card->data);
|
||||
onChangeSize();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Viewers
|
||||
|
||||
@@ -73,14 +73,15 @@ class DataViewer : public SetView {
|
||||
|
||||
/// Notification that the total image has changed
|
||||
virtual void onChange() {}
|
||||
|
||||
/// Notification that the viewers are initialized
|
||||
virtual void onInit() {}
|
||||
/// Notification that the size of the viewer may have changed
|
||||
virtual void onChangeSize() {}
|
||||
|
||||
vector<ValueViewerP> viewers; ///< The viewers for the different values in the data
|
||||
CardP card; ///< The card that is currently displayed, if any
|
||||
public:
|
||||
StyleSheetP stylesheet; ///< Stylesheet being used
|
||||
mutable StyleSheetP stylesheet; ///< Stylesheet being used
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
|
||||
Reference in New Issue
Block a user