[python] matplotlib: check float type of the head_width arg of arrow function

This commit is contained in:
Émilie Feral
2020-05-19 11:09:08 +02:00
parent 9b7c47a7f0
commit 0c9fb57b33

View File

@@ -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);
}