1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-26 12:18:51 -05:00

Fix cursor test tracking mode drawing

Related to #1461.
This commit is contained in:
Camilla Löwy 2019-04-10 19:03:36 +02:00 committed by Camilla Löwy
parent 718609275d
commit 45a62adf82

View File

@ -370,14 +370,14 @@ int main(void)
glViewport(0, 0, fb_width, fb_height); glViewport(0, 0, fb_width, fb_height);
scale = (float) fb_width / (float) wnd_width; scale = (float) fb_width / (float) wnd_width;
vertices[0][0] = 0.f; vertices[0][0] = 0.5f;
vertices[0][1] = (float) (fb_height - cursor_y * scale); vertices[0][1] = (float) (fb_height - floor(cursor_y * scale) - 1.f + 0.5f);
vertices[1][0] = (float) fb_width; vertices[1][0] = (float) fb_width + 0.5f;
vertices[1][1] = (float) (fb_height - cursor_y * scale); vertices[1][1] = (float) (fb_height - floor(cursor_y * scale) - 1.f + 0.5f);
vertices[2][0] = (float) (cursor_x * scale); vertices[2][0] = (float) floor(cursor_x * scale) + 0.5f;
vertices[2][1] = 0.f; vertices[2][1] = 0.5f;
vertices[3][0] = (float) (cursor_x * scale); vertices[3][0] = (float) floor(cursor_x * scale) + 0.5f;
vertices[3][1] = (float) fb_height; vertices[3][1] = (float) fb_height + 0.5f;
glBufferData(GL_ARRAY_BUFFER, glBufferData(GL_ARRAY_BUFFER,
sizeof(vertices), sizeof(vertices),