Implement bounding box for selected layers (#349)

* Implement bounding box for selected layers

* Add shift modifier for multi selection
This commit is contained in:
TrueDoctor
2021-08-20 09:57:00 +02:00
committed by Keavon Chambers
parent 7c64e1a816
commit 68d8ae4804
10 changed files with 159 additions and 72 deletions

View File

@@ -131,7 +131,7 @@ impl Default for Mapping {
entry! {action=MovementMessage::DisableSnapping, key_up=KeyShift},
// Select
entry! {action=SelectMessage::MouseMove, message=InputMapperMessage::PointerMove},
entry! {action=SelectMessage::DragStart, key_down=Lmb},
entry! {action=SelectMessage::DragStart{add_to_selection: KeyShift}, key_down=Lmb},
entry! {action=SelectMessage::DragStop, key_up=Lmb},
entry! {action=SelectMessage::Abort, key_down=Rmb},
entry! {action=SelectMessage::Abort, key_down=KeyEscape},

View File

@@ -1,4 +1,5 @@
use crate::message_prelude::*;
use serde::{Deserialize, Serialize};
pub const NUMBER_OF_KEYS: usize = Key::NumKeys as usize;
// Edit this to specify the storage type used
@@ -12,7 +13,7 @@ const KEY_MASK_STORAGE_LENGTH: usize = (NUMBER_OF_KEYS + STORAGE_SIZE_BITS - 1)
pub type KeyStates = BitVector<KEY_MASK_STORAGE_LENGTH>;
#[impl_message(Message, InputMapperMessage, KeyDown)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Key {
UnknownKey,
// MouseKeys