Skip to content

Commit

Permalink
Fix Cursor Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
malisipi committed Aug 4, 2022
1 parent 5ab9b56 commit f4e1eb5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion events.v
Original file line number Diff line number Diff line change
Expand Up @@ -165,27 +165,32 @@ fn move_fn(x f32, y f32, mut app &Window){
if app.active_dialog!=""{
objects=app.dialog_objects.clone().reverse()
}
sapp.set_mouse_cursor(.default)

mut changed_cursor:=false
for mut object in objects{
if !object["hi"].bol && object["type"].str!="rect" && object["type"].str!="group" && object["type"].str!="table"{
if object["x"].num<x && object["x"].num+object["w"].num>x{
if object["y"].num<y && object["y"].num+object["h"].num>y{
match object["type"].str {
"textbox", "password", "textarea"{
sapp.set_mouse_cursor(.ibeam)
changed_cursor=true
break
} "link" {
sapp.set_mouse_cursor(.pointing_hand)
changed_cursor=true
break
} else {
sapp.set_mouse_cursor(.default)
changed_cursor=true
break
}
}
}
}
}
}
if !changed_cursor { sapp.set_mouse_cursor(.default) }

if !(app.focus==""){
mut object:=get_object_by_id(app,app.focus)
Expand Down

0 comments on commit f4e1eb5

Please sign in to comment.