mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-21 22:08:12 +08:00
Tweak whitespace around use statements and other lint fixes
This commit is contained in:
@@ -45,6 +45,7 @@ impl<'a> MessageHandler<ToolMessage, ToolActionHandlerData<'a>> for Ellipse {
|
||||
|
||||
fn actions(&self) -> ActionList {
|
||||
use EllipseToolFsmState::*;
|
||||
|
||||
match self.fsm_state {
|
||||
Ready => actions!(EllipseMessageDiscriminant; DragStart),
|
||||
Drawing => actions!(EllipseMessageDiscriminant; DragStop, Abort, Resize),
|
||||
@@ -81,9 +82,11 @@ impl Fsm for EllipseToolFsmState {
|
||||
input: &InputPreprocessorMessageHandler,
|
||||
responses: &mut VecDeque<Message>,
|
||||
) -> Self {
|
||||
let mut shape_data = &mut data.data;
|
||||
use EllipseMessage::*;
|
||||
use EllipseToolFsmState::*;
|
||||
|
||||
let mut shape_data = &mut data.data;
|
||||
|
||||
if let ToolMessage::Ellipse(event) = event {
|
||||
match (self, event) {
|
||||
(Ready, DragStart) => {
|
||||
|
||||
@@ -73,6 +73,7 @@ impl Fsm for EyedropperToolFsmState {
|
||||
) -> Self {
|
||||
use EyedropperMessage::*;
|
||||
use EyedropperToolFsmState::*;
|
||||
|
||||
if let ToolMessage::Eyedropper(event) = event {
|
||||
match (self, event) {
|
||||
(Ready, lmb_or_rmb) if lmb_or_rmb == LeftMouseDown || lmb_or_rmb == RightMouseDown => {
|
||||
|
||||
@@ -73,6 +73,7 @@ impl Fsm for FillToolFsmState {
|
||||
) -> Self {
|
||||
use FillMessage::*;
|
||||
use FillToolFsmState::*;
|
||||
|
||||
if let ToolMessage::Fill(event) = event {
|
||||
match (self, event) {
|
||||
(Ready, lmb_or_rmb) if lmb_or_rmb == LeftMouseDown || lmb_or_rmb == RightMouseDown => {
|
||||
|
||||
@@ -44,6 +44,7 @@ impl<'a> MessageHandler<ToolMessage, ToolActionHandlerData<'a>> for Navigate {
|
||||
|
||||
fn actions(&self) -> ActionList {
|
||||
use NavigateToolFsmState::*;
|
||||
|
||||
match self.fsm_state {
|
||||
Ready => actions!(NavigateMessageDiscriminant; TranslateCanvasBegin, RotateCanvasBegin, ZoomCanvasBegin),
|
||||
_ => actions!(NavigateMessageDiscriminant; ClickZoom, MouseMove, TransformCanvasEnd),
|
||||
|
||||
@@ -52,6 +52,7 @@ impl<'a> MessageHandler<ToolMessage, ToolActionHandlerData<'a>> for Path {
|
||||
// Different actions depending on state may be wanted:
|
||||
fn actions(&self) -> ActionList {
|
||||
use PathToolFsmState::*;
|
||||
|
||||
match self.fsm_state {
|
||||
Ready => actions!(PathMessageDiscriminant; DragStart),
|
||||
Dragging => actions!(PathMessageDiscriminant; DragStop, PointerMove),
|
||||
|
||||
@@ -54,6 +54,7 @@ impl<'a> MessageHandler<ToolMessage, ToolActionHandlerData<'a>> for Pen {
|
||||
|
||||
fn actions(&self) -> ActionList {
|
||||
use PenToolFsmState::*;
|
||||
|
||||
match self.fsm_state {
|
||||
Ready => actions!(PenMessageDiscriminant; Undo, DragStart, DragStop, Confirm, Abort),
|
||||
Drawing => actions!(PenMessageDiscriminant; DragStop, PointerMove, Confirm, Abort),
|
||||
@@ -88,10 +89,11 @@ impl Fsm for PenToolFsmState {
|
||||
input: &InputPreprocessorMessageHandler,
|
||||
responses: &mut VecDeque<Message>,
|
||||
) -> Self {
|
||||
let transform = document.graphene_document.root.transform;
|
||||
|
||||
use PenMessage::*;
|
||||
use PenToolFsmState::*;
|
||||
|
||||
let transform = document.graphene_document.root.transform;
|
||||
|
||||
if let ToolMessage::Pen(event) = event {
|
||||
match (self, event) {
|
||||
(Ready, DragStart) => {
|
||||
|
||||
@@ -45,6 +45,7 @@ impl<'a> MessageHandler<ToolMessage, ToolActionHandlerData<'a>> for Rectangle {
|
||||
|
||||
fn actions(&self) -> ActionList {
|
||||
use RectangleToolFsmState::*;
|
||||
|
||||
match self.fsm_state {
|
||||
Ready => actions!(RectangleMessageDiscriminant; DragStart),
|
||||
Drawing => actions!(RectangleMessageDiscriminant; DragStop, Abort, Resize),
|
||||
@@ -80,9 +81,11 @@ impl Fsm for RectangleToolFsmState {
|
||||
input: &InputPreprocessorMessageHandler,
|
||||
responses: &mut VecDeque<Message>,
|
||||
) -> Self {
|
||||
let mut shape_data = &mut data.data;
|
||||
use RectangleMessage::*;
|
||||
use RectangleToolFsmState::*;
|
||||
|
||||
let mut shape_data = &mut data.data;
|
||||
|
||||
if let ToolMessage::Rectangle(event) = event {
|
||||
match (self, event) {
|
||||
(Ready, DragStart) => {
|
||||
|
||||
@@ -56,6 +56,7 @@ impl<'a> MessageHandler<ToolMessage, ToolActionHandlerData<'a>> for Select {
|
||||
|
||||
fn actions(&self) -> ActionList {
|
||||
use SelectToolFsmState::*;
|
||||
|
||||
match self.fsm_state {
|
||||
Ready => actions!(SelectMessageDiscriminant; DragStart),
|
||||
Dragging => actions!(SelectMessageDiscriminant; DragStop, MouseMove),
|
||||
@@ -229,7 +230,7 @@ impl Fsm for SelectToolFsmState {
|
||||
data.drag_current = mouse_position + closest_move;
|
||||
Dragging
|
||||
}
|
||||
(DrawingBox, MouseMove { snap_angle: _ }) => {
|
||||
(DrawingBox, MouseMove { .. }) => {
|
||||
data.drag_current = input.mouse.position;
|
||||
let half_pixel_offset = DVec2::splat(0.5);
|
||||
let start = data.drag_start + half_pixel_offset;
|
||||
|
||||
@@ -46,6 +46,7 @@ impl<'a> MessageHandler<ToolMessage, ToolActionHandlerData<'a>> for Shape {
|
||||
|
||||
fn actions(&self) -> ActionList {
|
||||
use ShapeToolFsmState::*;
|
||||
|
||||
match self.fsm_state {
|
||||
Ready => actions!(ShapeMessageDiscriminant; DragStart),
|
||||
Drawing => actions!(ShapeMessageDiscriminant; DragStop, Abort, Resize),
|
||||
@@ -82,9 +83,11 @@ impl Fsm for ShapeToolFsmState {
|
||||
input: &InputPreprocessorMessageHandler,
|
||||
responses: &mut VecDeque<Message>,
|
||||
) -> Self {
|
||||
let mut shape_data = &mut data.data;
|
||||
use ShapeMessage::*;
|
||||
use ShapeToolFsmState::*;
|
||||
|
||||
let mut shape_data = &mut data.data;
|
||||
|
||||
if let ToolMessage::Shape(event) = event {
|
||||
match (self, event) {
|
||||
(Ready, DragStart) => {
|
||||
|
||||
Reference in New Issue
Block a user