mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[python] matplotlib: check float type of the head_width arg of arrow function
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user