Skip to content

Commit d9582fa

Browse files
Merge branch 'master' into add-arrow-shape-feature-cleaned
2 parents 33c67a5 + 479688d commit d9582fa

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

editor/src/messages/input_mapper/utility_types/input_mouse.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ pub struct EditorMouseState {
7676

7777
impl 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,

node-graph/nodes/vector/src/vector_nodes.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)