Box decorations have priority over box insides. If a click is on a move or resize affordance, that takes priority over it also being inside a box.
When a click is inside two boxes the innermost box takes precedence.
If the boxes merely overlap and it's unclear that one is wholly within the other, then we continue to throw up our hands and return unpredictable results.
This one small change already feels quite nice for nested boxes!
ZYFZDE4QPECNSYJIZWVC6CPABEHUUIBSFHFGOUECVY5D6JO3LR2QC LMWVTKPYTMQYYN3MCVG7QRO4G3WCDH6RNBX7SWMT7LFBTUIQF6XAC KE5Y35NLUOAEUVO4IYKQQEWPQYIW3OLXUDL7RDZ4GWICJWT3BUMQC R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC 3GK7GC2WTTU4K76MD7DN6W4UPSFTYSEJMTGG4P7ADEHLH6K3P4IQC FBDRJ53NJ5BWDQGU2GWZ6NEYHKCCRD7RODMIG7QQZBRFUB4HR7OAC KDIC32VKQ4Z7UAWIJBTUNXZWKJIZ4FTGUN5TCILOLIC5LYWQZEOQC JEU6WFE4P76EHWWJ3DFX32WVHP3JFNUOHZ7LCNWKESVXSRAGU5TQC FHLFZZ3SG5VGJX25JID6A6C5XLT6Q76RAJDQSYQSZTXQMSIUTCCAC TK73HJVXQCBEEN4ATMLSSG4DI2XZJAQEJICJ472E3YAW55EFAT5AC WKMW7PCE75A5CFXF5GPL5HQ4ZNASFOFQFHASOQ7LABSQKWU3KEGAC ZANGJNNX6EITFBOF6NWCF2EM5BDQDEIOD4UPWMF5I6SKAURRTIHAC XBACST6NPLIFAHQGDXURH7E7WQ5KILLUSJB3Y65UP5EAYOWRMRUQC N626XGXDIQJJSDF3OK6OUPE7TQCRYURI3GY3Y7UKS4T22EWHPYKAC DXFOMHQIWZ6EAUIDZQLY3ZRRDWJRB2VQHJXHBBNXQYCYCABIMJ5QC B3ZC44KYSYCCNVPNA7UZL6XFCD27O37PNHZ2SS45Q6V6UXHDW5IAC -- return b if it's entirely within ainner = function(a, b)if a == nil then return b endif a.x >= b.x then return a endif b.x+b.w >= a.x+a.w thenreturn aendif a.y >= b.y then return a endif b.y + node_height(b) >= a.y + node_height(a) thenreturn aendreturn bend
local node = on_node(sx,sy)if node then-- position cursor in nodeCursor_node = nodeprint('within node')edit.mouse_press(node.editor, x,y, mouse_button, is_touch, presses)print('cursor at', node.editor.cursor_x, node.editor.cursor_y)returnend