From 0c9fb57b33878b1b785959c161383da9c38e23a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 19 May 2020 11:09:08 +0200 Subject: [PATCH] [python] matplotlib: check float type of the head_width arg of arrow function --- python/port/mod/matplotlib/pyplot/plot_store.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/port/mod/matplotlib/pyplot/plot_store.cpp b/python/port/mod/matplotlib/pyplot/plot_store.cpp index c34c5c2d3..023cd3461 100644 --- a/python/port/mod/matplotlib/pyplot/plot_store.cpp +++ b/python/port/mod/matplotlib/pyplot/plot_store.cpp @@ -103,14 +103,14 @@ PlotStore::Segment::Segment(mp_obj_t tuple) { m_yStart = mp_obj_get_float(elements[1]); m_xEnd = mp_obj_get_float(elements[2]); m_yEnd = mp_obj_get_float(elements[3]); - m_color = KDColor::RGB16(mp_obj_get_int(elements[4])); - m_arrowWidth = mp_obj_get_float(elements[5]); + m_arrowWidth = mp_obj_get_float(elements[4]); + m_color = KDColor::RGB16(mp_obj_get_int(elements[5])); } void PlotStore::addSegment(mp_obj_t xStart, mp_obj_t yStart, mp_obj_t xEnd, mp_obj_t yEnd, KDColor c, mp_obj_t arrowWidth) { mp_obj_t color = mp_obj_new_int(c); - mp_obj_t items[6] = {xStart, yStart, xEnd, yEnd, color, arrowWidth}; - checkFloatType(items, 4); + mp_obj_t items[6] = {xStart, yStart, xEnd, yEnd, arrowWidth, color}; + checkFloatType(items, 5); mp_obj_t tuple = mp_obj_new_tuple(6, items); mp_obj_list_append(m_segments, tuple); }