From 14b7b88b3f463fa85ea8561ab9b7171aef905f1d Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 24 Aug 2017 13:02:35 -0700 Subject: [PATCH] Take the last control point before closing a subpath into account --- font-renderer/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/font-renderer/src/lib.rs b/font-renderer/src/lib.rs index c7516191..0f23364e 100644 --- a/font-renderer/src/lib.rs +++ b/font-renderer/src/lib.rs @@ -208,6 +208,16 @@ impl FontContext { } } + if let Some(last_control_point_index) = current_control_point_index.take() { + let first_endpoint = glyph_outline_buffer.endpoints[first_endpoint_index as + usize]; + glyph_outline_buffer.endpoints.push(Endpoint { + position: first_endpoint.position, + control_point_index: last_control_point_index, + subpath_index: current_subpath_index, + }) + } + let last_endpoint_index = glyph_outline_buffer.endpoints.len() as u32; glyph_outline_buffer.subpaths.push(Subpath { first_endpoint_index: first_endpoint_index,