File tree Expand file tree Collapse file tree
editor/src/messages/input_mapper/utility_types
node-graph/nodes/vector/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ pub struct EditorMouseState {
7676
7777impl EditorMouseState {
7878 pub fn from_keys_and_editor_position ( keys : u8 , editor_position : EditorPosition ) -> Self {
79- let mouse_keys = MouseKeys :: from_bits ( keys) . expect ( "Invalid decoding of MouseKeys" ) ;
79+ // TODO: Some graphic tablets send key codes not mentioned in the spec. In the future we would like to support these as well.
80+ let mouse_keys = MouseKeys :: from_bits_truncate ( keys) ;
8081
8182 Self {
8283 editor_position,
Original file line number Diff line number Diff line change @@ -2275,6 +2275,9 @@ async fn index_points(
22752275) -> DVec2 {
22762276 let points_count = content. iter ( ) . map ( |row| row. element . point_domain . positions ( ) . len ( ) ) . sum :: < usize > ( ) ;
22772277
2278+ if points_count == 0 {
2279+ return DVec2 :: ZERO ;
2280+ }
22782281 // Clamp and allow negative indexing from the end
22792282 let index = index as isize ;
22802283 let index = if index < 0 {
You can’t perform that action at this time.
0 commit comments