Commit 7d374abf authored by twanvl's avatar twanvl

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
parent be95ba4d
...@@ -319,5 +319,5 @@ bool ChoiceValue::update(Context& ctx) { ...@@ -319,5 +319,5 @@ bool ChoiceValue::update(Context& ctx) {
} }
IMPLEMENT_REFLECTION_NAMELESS(ChoiceValue) { IMPLEMENT_REFLECTION_NAMELESS(ChoiceValue) {
if (fieldP->save_value || tag.scripting()) REFLECT_NAMELESS(value); if (fieldP->save_value || tag.scripting() || tag.reading()) REFLECT_NAMELESS(value);
} }
...@@ -98,5 +98,5 @@ bool ColorValue::update(Context& ctx) { ...@@ -98,5 +98,5 @@ bool ColorValue::update(Context& ctx) {
} }
IMPLEMENT_REFLECTION_NAMELESS(ColorValue) { IMPLEMENT_REFLECTION_NAMELESS(ColorValue) {
if (fieldP->save_value || tag.scripting()) REFLECT_NAMELESS(value); if (fieldP->save_value || tag.scripting() || tag.reading()) REFLECT_NAMELESS(value);
} }
...@@ -44,5 +44,5 @@ String ImageValue::toString() const { ...@@ -44,5 +44,5 @@ String ImageValue::toString() const {
} }
IMPLEMENT_REFLECTION_NAMELESS(ImageValue) { IMPLEMENT_REFLECTION_NAMELESS(ImageValue) {
if (fieldP->save_value || tag.scripting()) REFLECT_NAMELESS(filename); if (fieldP->save_value || tag.scripting() || tag.reading()) REFLECT_NAMELESS(filename);
} }
...@@ -55,5 +55,5 @@ String SymbolValue::toString() const { ...@@ -55,5 +55,5 @@ String SymbolValue::toString() const {
} }
IMPLEMENT_REFLECTION_NAMELESS(SymbolValue) { IMPLEMENT_REFLECTION_NAMELESS(SymbolValue) {
if (fieldP->save_value || tag.scripting()) REFLECT_NAMELESS(filename); if (fieldP->save_value || tag.scripting() || tag.reading()) REFLECT_NAMELESS(filename);
} }
...@@ -622,8 +622,22 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars, ...@@ -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())); line.end_or_soft = max(line.start, min(line.end_or_soft, line.end()));
lines.push_back(line); lines.push_back(line);
// does it fit vertically? // does it fit vertically?
return lines.empty() || if (style.paragraph_height > 0) {
lines.back().bottom() <= dc.getInternalSize().height - style.padding_bottom; // 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 { double TextViewer::lineLeft(RotatedDC& dc, const TextStyle& style, double y) const {
......
...@@ -50,8 +50,9 @@ class PackageManager { ...@@ -50,8 +50,9 @@ class PackageManager {
return typedP; return typedP;
} else { } else {
// not loaded, or loaded with wrong type (i.e. with just_header) // not loaded, or loaded with wrong type (i.e. with just_header)
p = typedP = new_intrusive<T>(); typedP = new_intrusive<T>();
typedP->open(filename); typedP->open(filename);
p = typedP;
return typedP; return typedP;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment