summaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
Diffstat (limited to 'dw')
-rw-r--r--dw/oofawarewidget.hh3
-rw-r--r--dw/textblock.cc12
2 files changed, 13 insertions, 2 deletions
diff --git a/dw/oofawarewidget.hh b/dw/oofawarewidget.hh
index e49cce14..8d18675e 100644
--- a/dw/oofawarewidget.hh
+++ b/dw/oofawarewidget.hh
@@ -249,7 +249,8 @@ public:
core::DrawingContext *context);
/**
- * ...
+ * Update content in flow, down from `ref`. Uses e. g. when floats sizes have
+ * changed.
*/
virtual void updateReference (int ref);
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 124e6a80..52eda3e1 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -3034,8 +3034,18 @@ void Textblock::queueDrawRange (int index1, int index2)
void Textblock::updateReference (int ref)
{
- if (words->size () > 0)
+ // The condition "(lines->size () > 0)" prevents CPU hogging in some cases,
+ // see devdoc/dw-miscellaneous.doc, "Relation between
+ // dw::core::Widget::markSizeChange and dw::core::Widget::queueResize".
+ //
+ // This condition is safe, since an implementation of
+ // dw::oof::OOFAwareWidget::updateReference should only affect content in
+ // flow, not widgets out of flow, like floats.
+
+ if (lines->size () > 0)
queueResize (ref, false);
+
+ // TODO: "if (words->size () > 0)" has to be considered.
}
void Textblock::widgetRefSizeChanged (int externalIndex)