Skip to content

Commit

Permalink
library: fix rendericon indexing and rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamcake committed Dec 1, 2024
1 parent 1599096 commit 03756f2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/library/gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,14 +1537,14 @@ void _bolt_gl_onDrawElements(GLenum mode, GLsizei count, GLenum type, const void
}
int32_t xy0[2];
int32_t xy2[2];
_bolt_get_attr_binding_int(c, vertex_userdata.position, i, 2, xy0);
_bolt_get_attr_binding_int(c, vertex_userdata.position, i + 2, 2, xy2);
_bolt_get_attr_binding_int(c, vertex_userdata.position, indices[i], 2, xy0);
_bolt_get_attr_binding_int(c, vertex_userdata.position, indices[i + 2], 2, xy2);
struct RenderItemIconEvent event;
event.icon = icon;
event.target_x = (int16_t)xy0[0];
event.target_y = (int16_t)(batch.screen_height - xy0[1]);
event.target_w = xy2[0] - xy0[0];
event.target_h = xy0[1] - xy2[1];
event.target_x = (int16_t)xy2[0];
event.target_y = (int16_t)((int32_t)batch.screen_height - xy2[1]);
event.target_w = (uint16_t)(xy0[0] - xy2[0]);
event.target_h = (uint16_t)(xy2[1] - xy0[1]);
_bolt_plugin_handle_rendericon(&event);
batch_start = i + batch.vertices_per_icon;
}
Expand Down

0 comments on commit 03756f2

Please sign in to comment.