Skip to content

Commit 171090c

Browse files
authored
Merge pull request #798 from oflebbe/precise
fix: use precise mouse wheel info in demos
2 parents 8868050 + 1c9bed7 commit 171090c

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

demo/rawfb/sdl/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ int main(int argc, char **argv)
216216
nk_input_button(&(context->ctx), sdl_button_to_nk(event.button.button), event.button.x, event.button.y,0);
217217
break;
218218
case SDL_MOUSEWHEEL:
219-
vec.x = event.wheel.x;
220-
vec.y = event.wheel.y;
219+
vec.x = event.wheel.preciseX;
220+
vec.y = event.wheel.preciseY;
221221
nk_input_scroll(&(context->ctx), vec );
222222

223223
break;

demo/sdl_opengl2/nuklear_sdl_gl2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ nk_sdl_handle_event(SDL_Event *evt)
349349
return 1;
350350

351351
case SDL_MOUSEWHEEL:
352-
nk_input_scroll(ctx,nk_vec2((float)evt->wheel.x,(float)evt->wheel.y));
352+
nk_input_scroll(ctx,nk_vec2(evt->wheel.preciseX, evt->wheel.preciseY));
353353
return 1;
354354
}
355355
return 0;

demo/sdl_opengl3/nuklear_sdl_gl3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ nk_sdl_handle_event(SDL_Event *evt)
459459
return 1;
460460

461461
case SDL_MOUSEWHEEL:
462-
nk_input_scroll(ctx,nk_vec2((float)evt->wheel.x,(float)evt->wheel.y));
462+
nk_input_scroll(ctx,nk_vec2(evt->wheel.preciseX, evt->wheel.preciseY));
463463
return 1;
464464
}
465465
return 0;

demo/sdl_opengles2/nuklear_sdl_gles2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ nk_sdl_handle_event(SDL_Event *evt)
459459
return 1;
460460

461461
case SDL_MOUSEWHEEL:
462-
nk_input_scroll(ctx,nk_vec2((float)evt->wheel.x,(float)evt->wheel.y));
462+
nk_input_scroll(ctx,nk_vec2(evt->wheel.preciseX, evt->wheel.preciseY));
463463
return 1;
464464
}
465465
return 0;

demo/sdl_renderer/nuklear_sdl_renderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ nk_sdl_handle_event(SDL_Event *evt)
382382
return 1;
383383

384384
case SDL_MOUSEWHEEL:
385-
nk_input_scroll(ctx,nk_vec2((float)evt->wheel.x,(float)evt->wheel.y));
385+
nk_input_scroll(ctx,nk_vec2(evt->wheel.preciseX, evt->wheel.preciseY));
386386
return 1;
387387
}
388388
return 0;

demo/sdl_vulkan/nuklear_sdl_vulkan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ NK_API int nk_sdl_handle_event(SDL_Event *evt) {
13821382
}
13831383

13841384
case SDL_MOUSEWHEEL:
1385-
nk_input_scroll(ctx, nk_vec2((float)evt->wheel.x, (float)evt->wheel.y));
1385+
nk_input_scroll(ctx,nk_vec2(evt->wheel.preciseX, evt->wheel.preciseY));
13861386
return 1;
13871387
}
13881388
return 0;

demo/sdl_vulkan/src/nuklear_sdl_vulkan.in.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ NK_API int nk_sdl_handle_event(SDL_Event *evt) {
11541154
}
11551155

11561156
case SDL_MOUSEWHEEL:
1157-
nk_input_scroll(ctx, nk_vec2((float)evt->wheel.x, (float)evt->wheel.y));
1157+
nk_input_scroll(ctx,nk_vec2(evt->wheel.preciseX, evt->wheel.preciseY));
11581158
return 1;
11591159
}
11601160
return 0;

0 commit comments

Comments
 (0)