aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2020-11-02 12:03:58 +0100
committerAndre Weissflog <floooh@gmail.com>2020-11-02 12:03:58 +0100
commit8bd84d3bd9a12a27a6537fcc8c9de4e70812df50 (patch)
tree7ee86a718d2160f217631de0d99e01626f56388a
parent8ee954f48616d92d2afd16b626cb4a7f3c9d54a1 (diff)
sokol_imgui.h: fix a bug in vertex offset dirty check (fixes #418)
-rw-r--r--util/sokol_imgui.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/sokol_imgui.h b/util/sokol_imgui.h
index df379bd2..cd83e9ef 100644
--- a/util/sokol_imgui.h
+++ b/util/sokol_imgui.h
@@ -1965,9 +1965,9 @@ SOKOL_API_IMPL void simgui_render(void) {
else {
if ((tex_id != pcmd->TextureId) || (vtx_offset != pcmd->VtxOffset)) {
tex_id = pcmd->TextureId;
- vtx_offset = pcmd->VtxOffset * sizeof(ImDrawVert);
+ vtx_offset = pcmd->VtxOffset;
bind.fs_images[0].id = (uint32_t)(uintptr_t)tex_id;
- bind.vertex_buffer_offsets[0] = vb_offset + vtx_offset;
+ bind.vertex_buffer_offsets[0] = vb_offset + pcmd->VtxOffset * sizeof(ImDrawVert);
sg_apply_bindings(&bind);
}
const int scissor_x = (int) (pcmd->ClipRect.x * dpi_scale);