I'm pretty sure this is a bug because I can't figure out how this behaviour would make sense.
The Layout object has a .clear() method which I assume is meant to be used to clear all text and then re-use it. However, after resetting the Vec of line_metrics it calls self.line_metrics.push(LinePosition::default());, i.e. it pushes a line from glyph 0..0 with completely default metrics. It doesn't do this when the self.line_metrics is initially created, and it screws up code that relies on line_metrics to work out layouted lines.
Am I missing something in saying that this line should simply be removed?
I'm pretty sure this is a bug because I can't figure out how this behaviour would make sense.
The Layout object has a .clear() method which I assume is meant to be used to clear all text and then re-use it. However, after resetting the Vec of
line_metricsit callsself.line_metrics.push(LinePosition::default());, i.e. it pushes a line from glyph0..0with completely default metrics. It doesn't do this when theself.line_metricsis initially created, and it screws up code that relies online_metricsto work out layouted lines.Am I missing something in saying that this line should simply be removed?