From 15fb97c688ed4cf3be4682e610bada34619e90bc Mon Sep 17 00:00:00 2001 From: Jake Norbut Date: Fri, 12 Jul 2019 17:11:00 -0500 Subject: [PATCH] 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 --- .../spark/view/Utility/IVisualContentRect.cs | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/client/spark/view/Utility/IVisualContentRect.cs b/src/client/spark/view/Utility/IVisualContentRect.cs index 8d42f7d29..81ab7bc85 100644 --- a/src/client/spark/view/Utility/IVisualContentRect.cs +++ b/src/client/spark/view/Utility/IVisualContentRect.cs @@ -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() {