with paragraph_height text now resizes if a single paragraph becomes full;

Fixed issue with reader looping when save_value=false;
Package manager will not contain packages that failed to load

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@681 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-09-09 18:12:55 +00:00
parent 7f24ab3765
commit 1dbdbd5786
6 changed files with 22 additions and 7 deletions
+1 -1
View File
@@ -319,5 +319,5 @@ bool ChoiceValue::update(Context& ctx) {
}
IMPLEMENT_REFLECTION_NAMELESS(ChoiceValue) {
if (fieldP->save_value || tag.scripting()) REFLECT_NAMELESS(value);
if (fieldP->save_value || tag.scripting() || tag.reading()) REFLECT_NAMELESS(value);
}
+1 -1
View File
@@ -98,5 +98,5 @@ bool ColorValue::update(Context& ctx) {
}
IMPLEMENT_REFLECTION_NAMELESS(ColorValue) {
if (fieldP->save_value || tag.scripting()) REFLECT_NAMELESS(value);
if (fieldP->save_value || tag.scripting() || tag.reading()) REFLECT_NAMELESS(value);
}
+1 -1
View File
@@ -44,5 +44,5 @@ String ImageValue::toString() const {
}
IMPLEMENT_REFLECTION_NAMELESS(ImageValue) {
if (fieldP->save_value || tag.scripting()) REFLECT_NAMELESS(filename);
if (fieldP->save_value || tag.scripting() || tag.reading()) REFLECT_NAMELESS(filename);
}
+1 -1
View File
@@ -55,5 +55,5 @@ String SymbolValue::toString() const {
}
IMPLEMENT_REFLECTION_NAMELESS(SymbolValue) {
if (fieldP->save_value || tag.scripting()) REFLECT_NAMELESS(filename);
if (fieldP->save_value || tag.scripting() || tag.reading()) REFLECT_NAMELESS(filename);
}
+16 -2
View File
@@ -622,8 +622,22 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
line.end_or_soft = max(line.start, min(line.end_or_soft, line.end()));
lines.push_back(line);
// does it fit vertically?
return lines.empty() ||
lines.back().bottom() <= dc.getInternalSize().height - style.padding_bottom;
if (style.paragraph_height > 0) {
// height = max(paragraph_height) * paragraph_count
double max_height = 0;
// per paragraph alignment
size_t start = 0;
for (size_t last = 0 ; last < lines.size() ; ++last) {
if (lines[last].break_after != BREAK_SOFT || last == lines.size()) {
max_height = max(max_height, lines[last].bottom() - lines[start].top);
start = last + 1;
}
}
// how many paragraphs would fit?
int n = floor(0.5 + (dc.getInternalSize().height - style.padding_bottom) / style.paragraph_height);
lines.back().top = max_height * n - lines.back().line_height;
}
return lines.back().bottom() <= dc.getInternalSize().height - style.padding_bottom;
}
double TextViewer::lineLeft(RotatedDC& dc, const TextStyle& style, double y) const {
+2 -1
View File
@@ -50,8 +50,9 @@ class PackageManager {
return typedP;
} else {
// not loaded, or loaded with wrong type (i.e. with just_header)
p = typedP = new_intrusive<T>();
typedP = new_intrusive<T>();
typedP->open(filename);
p = typedP;
return typedP;
}
}