property to method to signify we are creating a new glyph run each time; one cannot set the BaselineOrigin after the glphy run has been created, so we need a new one

This commit is contained in:
Jake Norbut committed 2019-07-12 17:11:00 -05:00
1 parent 8553229119
commit 15fb97c688
1 file changed
+12 -13
@@ -135,19 +135,18 @@ namespace mbts.ui {
public Size available_size { get => _vcr.available_size; set => _vcr.available_size = value; }
public Size layout_size { get { _ensure_current(); return _vcr.layout_size; } }
public Rect content_area { get { _ensure_current(); return _vcr.content_area; } }
public GlyphRun glyph_run {
get {
if (_text_lines.is_null_or_empty())
return null;
_ensure_current();
Point pt = _vcr.content_area.BottomLeft;
if (_glyph_run == null) {
_glyph_run = _glyph_context.from_arranged(_font_size, pt, _glyph_indices, _advance_widths, _glyph_offsets);
} else if (_glyph_run.BaselineOrigin != pt) {
_glyph_run.BaselineOrigin = pt;
}
return _glyph_run;
}
public GlyphRun create_glyph_run() {
if (_text_lines.is_null_or_empty())
return null;
_ensure_current();
Point pt = _vcr.content_area.BottomLeft;
//if (_glyph_run == null) {
// _glyph_run = _glyph_context.from_arranged(_font_size, pt, _glyph_indices, _advance_widths, _glyph_offsets);
//} else if (_glyph_run.BaselineOrigin != pt) {
// _glyph_run.BaselineOrigin = pt;
//}
_glyph_run = _glyph_context.from_arranged(_font_size, pt, _glyph_indices, _advance_widths, _glyph_offsets);
return _glyph_run;
}
void _ensure_current() {