mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 22:58:46 +00:00
Merge remote-tracking branch 'offical/master'
This commit is contained in:
Vendored
+6
-1
@@ -319,7 +319,12 @@ default_draw_frame :: proc(ctx: ^Context, rect: Rect, colorid: Color_Type) {
|
||||
}
|
||||
}
|
||||
|
||||
init :: proc(ctx: ^Context, set_clipboard: proc(user_data: rawptr, text: string) -> (ok: bool), get_clipboard: proc(user_data: rawptr) -> (text: string, ok: bool), clipboard_user_data: rawptr) {
|
||||
init :: proc(
|
||||
ctx: ^Context,
|
||||
set_clipboard: proc(user_data: rawptr, text: string) -> (ok: bool) = nil,
|
||||
get_clipboard: proc(user_data: rawptr) -> (text: string, ok: bool) = nil,
|
||||
clipboard_user_data: rawptr = nil,
|
||||
) {
|
||||
ctx^ = {} // zero memory
|
||||
ctx.draw_frame = default_draw_frame
|
||||
ctx._style = default_style
|
||||
|
||||
Vendored
+6
-6
@@ -1443,7 +1443,12 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement) {
|
||||
wmi.storeU8(off(1), !!e.isTrusted);
|
||||
|
||||
let base = off(0, 8);
|
||||
if (e instanceof MouseEvent) {
|
||||
if (e instanceof WheelEvent) {
|
||||
wmi.storeF64(off(8), e.deltaX);
|
||||
wmi.storeF64(off(8), e.deltaY);
|
||||
wmi.storeF64(off(8), e.deltaZ);
|
||||
wmi.storeU32(off(4), e.deltaMode);
|
||||
} else if (e instanceof MouseEvent) {
|
||||
wmi.storeI64(off(8), e.screenX);
|
||||
wmi.storeI64(off(8), e.screenY);
|
||||
wmi.storeI64(off(8), e.clientX);
|
||||
@@ -1482,11 +1487,6 @@ function odinSetupDefaultImports(wasmMemoryInterface, consoleElement) {
|
||||
wmi.storeI32(off(W), e.code.length)
|
||||
wmi.storeString(off(16, 1), e.key);
|
||||
wmi.storeString(off(16, 1), e.code);
|
||||
} else if (e instanceof WheelEvent) {
|
||||
wmi.storeF64(off(8), e.deltaX);
|
||||
wmi.storeF64(off(8), e.deltaY);
|
||||
wmi.storeF64(off(8), e.deltaZ);
|
||||
wmi.storeU32(off(4), e.deltaMode);
|
||||
} else if (e.type === 'scroll') {
|
||||
wmi.storeF64(off(8), window.scrollX);
|
||||
wmi.storeF64(off(8), window.scrollY);
|
||||
|
||||
Reference in New Issue
Block a user