[draw] Emit move_to immediately, like other operators

This commit is contained in:
Behdad Esfahbod committed 2022-02-13 13:21:15 -06:00
1 parent aca80a4a40
commit 151f205819
3 files changed
+14 -19

No files matched your search

+5 -3
View File
@@ -97,8 +97,9 @@ struct hb_draw_funcs_t
float to_x, float to_y)
{
if (st.path_open) close_path (draw_data, st);
st.current_x = st.path_start_x = to_x;
st.current_y = st.path_start_y = to_y;
emit_move_to (draw_data, st, to_x, to_y);
st.current_x = to_x;
st.current_y = to_y;
}
void line_to (void *draw_data, hb_draw_state_t &st,
@@ -152,7 +153,8 @@ struct hb_draw_funcs_t
{
assert (!st.path_open);
st.path_open = true;
emit_move_to (draw_data, st, st.path_start_x, st.path_start_y);
st.path_start_x = st.current_x;
st.path_start_y = st.current_y;
}
};
DECLARE_NULL_INSTANCE (hb_draw_funcs_t);
+3
View File
@@ -534,6 +534,9 @@ hb_draw_move_to_default (hb_draw_funcs_t *dfuncs HB_UNUSED,
st->path_start_x *= x_scale;
st->path_start_y *= y_scale;
st->current_x *= x_scale;
st->current_y *= y_scale;
adaptor->draw_funcs->emit_move_to (adaptor->draw_data, *st,
x_scale * to_x, y_scale * to_y);
}