diff --git a/sources/iron_ui_nodes.c b/sources/iron_ui_nodes.c index 643b8b98..d6089943 100644 --- a/sources/iron_ui_nodes.c +++ b/sources/iron_ui_nodes.c @@ -1228,9 +1228,9 @@ void ui_node_canvas_encode(ui_node_canvas_t *canvas) { armpack_encode_string("type"); armpack_encode_string(canvas->nodes->buffer[i]->type); armpack_encode_string("x"); - armpack_encode_i32(canvas->nodes->buffer[i]->x); + armpack_encode_f32(canvas->nodes->buffer[i]->x); armpack_encode_string("y"); - armpack_encode_i32(canvas->nodes->buffer[i]->y); + armpack_encode_f32(canvas->nodes->buffer[i]->y); armpack_encode_string("color"); armpack_encode_i32(canvas->nodes->buffer[i]->color); @@ -1349,9 +1349,9 @@ uint32_t ui_node_canvas_encoded_size(ui_node_canvas_t *canvas) { size += armpack_size_string("type"); size += armpack_size_string(canvas->nodes->buffer[i]->type); size += armpack_size_string("x"); - size += armpack_size_i32(); + size += armpack_size_f32(); size += armpack_size_string("y"); - size += armpack_size_i32(); + size += armpack_size_f32(); size += armpack_size_string("color"); size += armpack_size_i32(); @@ -1433,7 +1433,7 @@ uint32_t ui_node_canvas_encoded_size(ui_node_canvas_t *canvas) { } size += armpack_size_string("width"); - size += armpack_size_i32(); + size += armpack_size_f32(); } size += armpack_size_string("links"); @@ -1525,7 +1525,7 @@ char *ui_node_canvas_to_json(ui_node_canvas_t *canvas) { } json_encode_end_array(); - json_encode_i32("width", canvas->nodes->buffer[i]->width); + json_encode_f32("width", canvas->nodes->buffer[i]->width); json_encode_end_object(); } json_encode_end_array(); diff --git a/sources/iron_ui_nodes.h b/sources/iron_ui_nodes.h index 46598a68..26319644 100644 --- a/sources/iron_ui_nodes.h +++ b/sources/iron_ui_nodes.h @@ -51,13 +51,13 @@ typedef PACK(struct ui_node { int id; char *name; char *type; - int x; // float x; - int y; // float y; + float x; + float y; uint32_t color; ui_node_socket_array_t *inputs; ui_node_socket_array_t *outputs; ui_node_button_array_t *buttons; - int width; // float width + float width; }) ui_node_t; typedef PACK(struct ui_node_link {