mirror of
				https://github.com/lightpanda-io/browser.git
				synced 2025-10-30 07:31:47 +00:00 
			
		
		
		
	Subpixel mouse events
This commit is contained in:
		| @@ -32,9 +32,10 @@ pub fn processMessage(cmd: anytype) !void { | ||||
| // https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent | ||||
| fn dispatchMouseEvent(cmd: anytype) !void { | ||||
|     const params = (try cmd.params(struct { | ||||
|         x: i32, | ||||
|         y: i32, | ||||
|         type: Type, | ||||
|         type: Type, // Type of the mouse event. | ||||
|         x: f32, // X coordinate of the event relative to the main frame's viewport. | ||||
|         y: f32, // Y coordinate of the event relative to the main frame's viewport. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport. | ||||
|         // Many optional parameters are not implemented yet, see documentation url. | ||||
|  | ||||
|         const Type = enum { | ||||
|             mousePressed, | ||||
| @@ -56,8 +57,8 @@ fn dispatchMouseEvent(cmd: anytype) !void { | ||||
|     const page = bc.session.currentPage() orelse return; | ||||
|  | ||||
|     const mouse_event = Page.MouseEvent{ | ||||
|         .x = params.x, | ||||
|         .y = params.y, | ||||
|         .x = @intFromFloat(params.x), // Decimal pixel values are not understood by netsurf or out rendered | ||||
|         .y = @intFromFloat(params.y), // So we convert them once at intake here | ||||
|         .type = switch (params.type) { | ||||
|             .mousePressed => .pressed, | ||||
|             .mouseReleased => .released, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 sjorsdonkers
					sjorsdonkers