mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-12-23 10:11:54 +00:00
Clean up and polish some code from the previous commit (#255)
This commit is contained in:
parent
39e6893630
commit
7ae91e8330
9 changed files with 88 additions and 79 deletions
|
|
@ -88,7 +88,7 @@
|
|||
|
||||
<Separator :type="SeparatorType.Section" />
|
||||
|
||||
<NumberInput :callback="setRotation" :initial_value="0" :step="15" :unit="`°`" :update_on_callback="false" ref="rotation" />
|
||||
<NumberInput :callback="setRotation" :initialValue="0" :step="15" :unit="`°`" :updateOnCallback="false" ref="rotation" />
|
||||
|
||||
<Separator :type="SeparatorType.Section" />
|
||||
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
|
||||
<Separator :type="SeparatorType.Related" />
|
||||
|
||||
<NumberInput :callback="setZoom" :initial_value="100" :min="0.001" :increaseMultiplier="1.25" :decreaseMultiplier="0.8" :unit="`%`" :update_on_callback="false" ref="zoom" />
|
||||
<NumberInput :callback="setZoom" :initialValue="100" :min="0.001" :increaseMultiplier="1.25" :decreaseMultiplier="0.8" :unit="`%`" :updateOnCallback="false" ref="zoom" />
|
||||
</div>
|
||||
</LayoutRow>
|
||||
<LayoutRow :class="'shelf-and-viewport'">
|
||||
|
|
@ -192,7 +192,7 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { ResponseType, registerResponseHandler, Response, UpdateCanvas, SetActiveTool, ExportDocument, SetZoom, SetRotation } from "../../response-handler";
|
||||
import { ResponseType, registerResponseHandler, Response, UpdateCanvas, SetActiveTool, ExportDocument, SetCanvasZoom, SetRotation } from "../../response-handler";
|
||||
import LayoutRow from "../layout/LayoutRow.vue";
|
||||
import LayoutCol from "../layout/LayoutCol.vue";
|
||||
import WorkingColors from "../widgets/WorkingColors.vue";
|
||||
|
|
@ -240,9 +240,9 @@ function makeModifiersBitfield(control: boolean, shift: boolean, alt: boolean):
|
|||
export default defineComponent({
|
||||
methods: {
|
||||
async viewportResize() {
|
||||
const { on_viewport_resize } = await wasm;
|
||||
const { viewport_resize } = await wasm;
|
||||
const canvas = this.$refs.canvas as HTMLDivElement;
|
||||
on_viewport_resize(canvas.clientWidth, canvas.clientHeight);
|
||||
viewport_resize(canvas.clientWidth, canvas.clientHeight);
|
||||
},
|
||||
async canvasMouseDown(e: MouseEvent) {
|
||||
const { on_mouse_down } = await wasm;
|
||||
|
|
@ -266,12 +266,12 @@ export default defineComponent({
|
|||
on_mouse_scroll(e.deltaX, e.deltaY, e.deltaZ, modifiers);
|
||||
},
|
||||
async setZoom(newZoom: number) {
|
||||
const { on_set_zoom } = await wasm;
|
||||
on_set_zoom(newZoom / 100);
|
||||
const { set_zoom } = await wasm;
|
||||
set_zoom(newZoom / 100);
|
||||
},
|
||||
async setRotation(newRotation: number) {
|
||||
const { on_set_rotation } = await wasm;
|
||||
on_set_rotation(newRotation * (Math.PI / 180));
|
||||
const { set_rotation } = await wasm;
|
||||
set_rotation(newRotation * (Math.PI / 180));
|
||||
},
|
||||
async keyDown(e: KeyboardEvent) {
|
||||
if (redirectKeyboardEventToBackend(e)) {
|
||||
|
|
@ -325,8 +325,8 @@ export default defineComponent({
|
|||
const toolData = responseData as SetActiveTool;
|
||||
if (toolData) this.activeTool = toolData.tool_name;
|
||||
});
|
||||
registerResponseHandler(ResponseType.SetZoom, (responseData: Response) => {
|
||||
const updateData = responseData as SetZoom;
|
||||
registerResponseHandler(ResponseType.SetCanvasZoom, (responseData: Response) => {
|
||||
const updateData = responseData as SetCanvasZoom;
|
||||
if (updateData) {
|
||||
const zoomWidget = this.$refs.zoom as typeof NumberInput;
|
||||
zoomWidget.setValue(updateData.new_zoom * 100);
|
||||
|
|
|
|||
|
|
@ -98,20 +98,21 @@ import { defineComponent } from "vue";
|
|||
export default defineComponent({
|
||||
components: {},
|
||||
props: {
|
||||
initial_value: { type: Number, default: 0, required: false },
|
||||
unit: { type: String, default: "", required: false },
|
||||
step: { type: Number, default: 1, required: false },
|
||||
increaseMultiplier: { type: Number, default: null, required: false },
|
||||
decreaseMultiplier: { type: Number, default: null, required: false },
|
||||
initialValue: { type: Number, default: 0 },
|
||||
unit: { type: String, default: "" },
|
||||
step: { type: Number, default: 1 },
|
||||
displayDecimalPlaces: { type: Number, default: 3 },
|
||||
increaseMultiplier: { type: Number, default: null },
|
||||
decreaseMultiplier: { type: Number, default: null },
|
||||
min: { type: Number, required: false },
|
||||
max: { type: Number, required: false },
|
||||
callback: { type: Function, required: false },
|
||||
update_on_callback: { type: Boolean, default: true, required: false },
|
||||
updateOnCallback: { type: Boolean, default: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: this.initial_value,
|
||||
text: this.initial_value.toString() + this.unit,
|
||||
value: this.initialValue,
|
||||
text: this.initialValue.toString() + this.unit,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -141,14 +142,16 @@ export default defineComponent({
|
|||
},
|
||||
setValue(newValue: number) {
|
||||
this.value = newValue;
|
||||
this.text = `${Math.round(this.value)}${this.unit}`;
|
||||
|
||||
const roundingPower = 10 ** this.displayDecimalPlaces;
|
||||
this.text = `${Math.round(this.value * roundingPower) / roundingPower}${this.unit}`;
|
||||
},
|
||||
updateValue(inValue: number, resetOnClamp: boolean) {
|
||||
const newValue = this.clampValue(inValue, resetOnClamp);
|
||||
|
||||
if (this.callback) this.callback(newValue);
|
||||
|
||||
if (this.update_on_callback) this.setValue(newValue);
|
||||
if (this.updateOnCallback) this.setValue(newValue);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export enum ResponseType {
|
|||
CloseDocument = "CloseDocument",
|
||||
UpdateWorkingColors = "UpdateWorkingColors",
|
||||
PromptCloseConfirmationModal = "PromptCloseConfirmationModal",
|
||||
SetZoom = "SetZoom",
|
||||
SetCanvasZoom = "SetCanvasZoom",
|
||||
SetRotation = "SetRotation",
|
||||
}
|
||||
|
||||
|
|
@ -66,8 +66,8 @@ function parseResponse(responseType: string, data: any): Response {
|
|||
return newCloseDocument(data.CloseDocument);
|
||||
case "UpdateCanvas":
|
||||
return newUpdateCanvas(data.UpdateCanvas);
|
||||
case "SetZoom":
|
||||
return newSetZoom(data.SetZoom);
|
||||
case "SetCanvasZoom":
|
||||
return newSetZoom(data.SetCanvasZoom);
|
||||
case "SetRotation":
|
||||
return newSetRotation(data.SetRotation);
|
||||
case "ExportDocument":
|
||||
|
|
@ -81,7 +81,7 @@ function parseResponse(responseType: string, data: any): Response {
|
|||
}
|
||||
}
|
||||
|
||||
export type Response = SetActiveTool | UpdateCanvas | DocumentChanged | CollapseFolder | ExpandFolder | UpdateWorkingColors | SetZoom | SetRotation;
|
||||
export type Response = SetActiveTool | UpdateCanvas | DocumentChanged | CollapseFolder | ExpandFolder | UpdateWorkingColors | SetCanvasZoom | SetRotation;
|
||||
|
||||
export interface CloseDocument {
|
||||
document_index: number;
|
||||
|
|
@ -181,10 +181,10 @@ function newExpandFolder(input: any): ExpandFolder {
|
|||
};
|
||||
}
|
||||
|
||||
export interface SetZoom {
|
||||
export interface SetCanvasZoom {
|
||||
new_zoom: number;
|
||||
}
|
||||
function newSetZoom(input: any): SetZoom {
|
||||
function newSetZoom(input: any): SetCanvasZoom {
|
||||
return {
|
||||
new_zoom: input.new_zoom,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ pub fn new_document() -> Result<(), JsValue> {
|
|||
// TODO: Call event when the panels are resized
|
||||
/// Viewport resized
|
||||
#[wasm_bindgen]
|
||||
pub fn on_viewport_resize(new_width: u32, new_height: u32) -> Result<(), JsValue> {
|
||||
pub fn viewport_resize(new_width: u32, new_height: u32) -> Result<(), JsValue> {
|
||||
let ev = InputPreprocessorMessage::ViewportResize(ViewportPosition { x: new_width, y: new_height });
|
||||
EDITOR_STATE.with(|editor| editor.borrow_mut().handle_message(ev)).map_err(convert_error)
|
||||
}
|
||||
|
|
@ -159,14 +159,14 @@ pub fn export_document() -> Result<(), JsValue> {
|
|||
|
||||
/// Sets the zoom to the value
|
||||
#[wasm_bindgen]
|
||||
pub fn on_set_zoom(new_zoom: f64) -> Result<(), JsValue> {
|
||||
let ev = DocumentMessage::SetZoom(new_zoom);
|
||||
pub fn set_zoom(new_zoom: f64) -> Result<(), JsValue> {
|
||||
let ev = DocumentMessage::SetCanvasZoom(new_zoom);
|
||||
EDITOR_STATE.with(|editor| editor.borrow_mut().handle_message(ev)).map_err(convert_error)
|
||||
}
|
||||
|
||||
/// Sets the rotation to the new value (in radians)
|
||||
#[wasm_bindgen]
|
||||
pub fn on_set_rotation(new_radians: f64) -> Result<(), JsValue> {
|
||||
pub fn set_rotation(new_radians: f64) -> Result<(), JsValue> {
|
||||
let ev = DocumentMessage::SetRotation(new_radians);
|
||||
EDITOR_STATE.with(|editor| editor.borrow_mut().handle_message(ev)).map_err(convert_error)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ impl Dispatcher {
|
|||
| Message::InputMapper(_)
|
||||
| Message::Document(DocumentMessage::RenderDocument)
|
||||
| Message::Frontend(FrontendMessage::UpdateCanvas { .. })
|
||||
| Message::Frontend(FrontendMessage::SetZoom { .. })
|
||||
| Message::Frontend(FrontendMessage::SetCanvasZoom { .. })
|
||||
| Message::Frontend(FrontendMessage::SetRotation { .. })
|
||||
| Message::Document(DocumentMessage::DispatchOperation { .. })
|
||||
) || MessageDiscriminant::from(&message).local_name().ends_with("MouseMove"))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
pub const PLUS_KEY_MULTIPLIER: f64 = 1.25;
|
||||
pub const MINUS_KEY_MULTIPLIER: f64 = 0.8;
|
||||
pub const PLUS_KEY_ZOOM_MULTIPLIER: f64 = 1.25;
|
||||
pub const MINUS_KEY_ZOOM_MULTIPLIER: f64 = 0.8;
|
||||
|
||||
pub const VIEWPORT_ZOOM_SCALE_MIN: f64 = 0.000_001;
|
||||
pub const VIEWPORT_ZOOM_SCALE_MAX: f64 = 1_000_000.;
|
||||
|
||||
pub const WHEEL_ZOOM_DIVISOR: f64 = 500.;
|
||||
pub const MOUSE_ZOOM_DIVISOR: f64 = 400.;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::message_prelude::*;
|
||||
use crate::{
|
||||
consts::{MOUSE_ZOOM_DIVISOR, WHEEL_ZOOM_DIVISOR},
|
||||
consts::{MOUSE_ZOOM_DIVISOR, VIEWPORT_ZOOM_SCALE_MAX, VIEWPORT_ZOOM_SCALE_MIN, WHEEL_ZOOM_DIVISOR},
|
||||
input::{mouse::ViewportPosition, InputPreprocessor},
|
||||
};
|
||||
use document_core::layers::Layer;
|
||||
|
|
@ -39,15 +39,14 @@ pub enum DocumentMessage {
|
|||
RenderDocument,
|
||||
Undo,
|
||||
MouseMove,
|
||||
TranslateDown,
|
||||
TranslateUp,
|
||||
WheelTranslate,
|
||||
RotateDown { snap: bool },
|
||||
ZoomDown,
|
||||
TransformUp,
|
||||
SetZoom(f64),
|
||||
MultiplyZoom(f64),
|
||||
WheelZoom,
|
||||
TranslateCanvasBegin,
|
||||
WheelCanvasTranslate,
|
||||
RotateCanvasBegin { snap: bool },
|
||||
ZoomCanvasBegin,
|
||||
TranslateCanvasEnd,
|
||||
SetCanvasZoom(f64),
|
||||
MultiplyCanvasZoom(f64),
|
||||
WheelCanvasZoom,
|
||||
SetRotation(f64),
|
||||
NudgeSelectedLayers(f64, f64),
|
||||
}
|
||||
|
|
@ -380,21 +379,22 @@ impl MessageHandler<DocumentMessage, &InputPreprocessor> for DocumentMessageHand
|
|||
}
|
||||
.into(),
|
||||
),
|
||||
TranslateDown => {
|
||||
TranslateCanvasBegin => {
|
||||
self.translating = true;
|
||||
self.mouse_pos = ipp.mouse.position;
|
||||
}
|
||||
RotateDown { snap } => {
|
||||
RotateCanvasBegin { snap } => {
|
||||
self.rotating = true;
|
||||
let layerdata = self.layerdata_mut(&vec![]);
|
||||
// TODO: Set up the input system to allow the addition of the Shift key to begin snapping while rotating without snapping
|
||||
layerdata.snap_rotate = snap;
|
||||
self.mouse_pos = ipp.mouse.position;
|
||||
}
|
||||
ZoomDown => {
|
||||
ZoomCanvasBegin => {
|
||||
self.zooming = true;
|
||||
self.mouse_pos = ipp.mouse.position;
|
||||
}
|
||||
TransformUp => {
|
||||
TranslateCanvasEnd => {
|
||||
let layerdata = self.layerdata_mut(&vec![]);
|
||||
layerdata.rotation = layerdata.snapped_angle();
|
||||
layerdata.snap_rotate = false;
|
||||
|
|
@ -433,25 +433,27 @@ impl MessageHandler<DocumentMessage, &InputPreprocessor> for DocumentMessageHand
|
|||
let difference = self.mouse_pos.y as f64 - ipp.mouse.position.y as f64;
|
||||
let amount = 1. + difference / MOUSE_ZOOM_DIVISOR;
|
||||
let layerdata = self.layerdata_mut(&vec![]);
|
||||
layerdata.scale *= amount;
|
||||
responses.push_back(FrontendMessage::SetZoom { new_zoom: layerdata.scale }.into());
|
||||
let new = (layerdata.scale * amount).clamp(VIEWPORT_ZOOM_SCALE_MIN, VIEWPORT_ZOOM_SCALE_MAX);
|
||||
layerdata.scale = new;
|
||||
responses.push_back(FrontendMessage::SetCanvasZoom { new_zoom: layerdata.scale }.into());
|
||||
self.create_document_transform_from_layerdata(&ipp.viewport_size, responses);
|
||||
}
|
||||
self.mouse_pos = ipp.mouse.position;
|
||||
}
|
||||
SetZoom(new) => {
|
||||
SetCanvasZoom(new) => {
|
||||
let layerdata = self.layerdata_mut(&vec![]);
|
||||
layerdata.scale = new.clamp(VIEWPORT_ZOOM_SCALE_MIN, VIEWPORT_ZOOM_SCALE_MAX);
|
||||
responses.push_back(FrontendMessage::SetCanvasZoom { new_zoom: layerdata.scale }.into());
|
||||
self.create_document_transform_from_layerdata(&ipp.viewport_size, responses);
|
||||
}
|
||||
MultiplyCanvasZoom(multiplier) => {
|
||||
let layerdata = self.layerdata_mut(&vec![]);
|
||||
let new = (layerdata.scale * multiplier).clamp(VIEWPORT_ZOOM_SCALE_MIN, VIEWPORT_ZOOM_SCALE_MAX);
|
||||
layerdata.scale = new;
|
||||
responses.push_back(FrontendMessage::SetZoom { new_zoom: layerdata.scale }.into());
|
||||
responses.push_back(FrontendMessage::SetCanvasZoom { new_zoom: layerdata.scale }.into());
|
||||
self.create_document_transform_from_layerdata(&ipp.viewport_size, responses);
|
||||
}
|
||||
MultiplyZoom(mult) => {
|
||||
let layerdata = self.layerdata_mut(&vec![]);
|
||||
layerdata.scale *= mult;
|
||||
responses.push_back(FrontendMessage::SetZoom { new_zoom: layerdata.scale }.into());
|
||||
self.create_document_transform_from_layerdata(&ipp.viewport_size, responses);
|
||||
}
|
||||
WheelZoom => {
|
||||
WheelCanvasZoom => {
|
||||
let scroll = ipp.mouse.scroll_delta.y as f64;
|
||||
let amount = if ipp.mouse.scroll_delta.y > 0 {
|
||||
1. + scroll / -WHEEL_ZOOM_DIVISOR
|
||||
|
|
@ -459,11 +461,12 @@ impl MessageHandler<DocumentMessage, &InputPreprocessor> for DocumentMessageHand
|
|||
1. / (1. + scroll / WHEEL_ZOOM_DIVISOR)
|
||||
};
|
||||
let layerdata = self.layerdata_mut(&vec![]);
|
||||
layerdata.scale *= amount;
|
||||
responses.push_back(FrontendMessage::SetZoom { new_zoom: layerdata.scale }.into());
|
||||
let new = (layerdata.scale * amount).clamp(VIEWPORT_ZOOM_SCALE_MIN, VIEWPORT_ZOOM_SCALE_MAX);
|
||||
layerdata.scale = new;
|
||||
responses.push_back(FrontendMessage::SetCanvasZoom { new_zoom: layerdata.scale }.into());
|
||||
self.create_document_transform_from_layerdata(&ipp.viewport_size, responses);
|
||||
}
|
||||
WheelTranslate => {
|
||||
WheelCanvasTranslate => {
|
||||
let delta = -ipp.mouse.scroll_delta.to_dvec2();
|
||||
let transformed_delta = self.active_document().document.root.transform.inverse().transform_vector2(delta);
|
||||
let layerdata = self.layerdata_mut(&vec![]);
|
||||
|
|
@ -491,9 +494,9 @@ impl MessageHandler<DocumentMessage, &InputPreprocessor> for DocumentMessageHand
|
|||
}
|
||||
fn actions(&self) -> ActionList {
|
||||
if self.active_document().layer_data.values().any(|data| data.selected) {
|
||||
actions!(DocumentMessageDiscriminant; Undo, SelectAllLayers, DeselectAllLayers, DeleteSelectedLayers, DuplicateSelectedLayers, RenderDocument, ExportDocument, NewDocument, CloseActiveDocument, NextDocument, PrevDocument, MouseMove, TransformUp, TranslateDown, CopySelectedLayers, PasteLayers, NudgeSelectedLayers, RotateDown, ZoomDown, SetZoom, MultiplyZoom, SetRotation, WheelZoom, WheelTranslate)
|
||||
actions!(DocumentMessageDiscriminant; Undo, SelectAllLayers, DeselectAllLayers, DeleteSelectedLayers, DuplicateSelectedLayers, RenderDocument, ExportDocument, NewDocument, CloseActiveDocument, NextDocument, PrevDocument, MouseMove, TranslateCanvasEnd, TranslateCanvasBegin, CopySelectedLayers, PasteLayers, NudgeSelectedLayers, RotateCanvasBegin, ZoomCanvasBegin, SetCanvasZoom, MultiplyCanvasZoom, SetRotation, WheelCanvasZoom, WheelCanvasTranslate)
|
||||
} else {
|
||||
actions!(DocumentMessageDiscriminant; Undo, SelectAllLayers, DeselectAllLayers, RenderDocument, ExportDocument, NewDocument, CloseActiveDocument, NextDocument, PrevDocument, MouseMove, TransformUp, TranslateDown, PasteLayers, RotateDown, ZoomDown, SetZoom, MultiplyZoom, SetRotation, WheelZoom, WheelTranslate)
|
||||
actions!(DocumentMessageDiscriminant; Undo, SelectAllLayers, DeselectAllLayers, RenderDocument, ExportDocument, NewDocument, CloseActiveDocument, NextDocument, PrevDocument, MouseMove, TranslateCanvasEnd, TranslateCanvasBegin, PasteLayers, RotateCanvasBegin, ZoomCanvasBegin, SetCanvasZoom, MultiplyCanvasZoom, SetRotation, WheelCanvasZoom, WheelCanvasTranslate)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ pub enum FrontendMessage {
|
|||
DisableTextInput,
|
||||
UpdateWorkingColors { primary: Color, secondary: Color },
|
||||
PromptCloseConfirmationModal,
|
||||
SetZoom { new_zoom: f64 },
|
||||
SetCanvasZoom { new_zoom: f64 },
|
||||
SetRotation { new_radians: f64 },
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ impl MessageHandler<FrontendMessage, ()> for FrontendMessageHandler {
|
|||
UpdateCanvas,
|
||||
EnableTextInput,
|
||||
DisableTextInput,
|
||||
SetZoom,
|
||||
SetCanvasZoom,
|
||||
SetRotation,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::consts::{MINUS_KEY_MULTIPLIER, PLUS_KEY_MULTIPLIER};
|
||||
use crate::consts::{MINUS_KEY_ZOOM_MULTIPLIER, PLUS_KEY_ZOOM_MULTIPLIER};
|
||||
use crate::message_prelude::*;
|
||||
use crate::tool::ToolType;
|
||||
|
||||
|
|
@ -186,18 +186,18 @@ impl Default for Mapping {
|
|||
entry! {action=DocumentMessage::ExportDocument, key_down=KeyS, modifiers=[KeyControl, KeyShift]},
|
||||
entry! {action=DocumentMessage::ExportDocument, key_down=KeyE, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::MouseMove, message=InputMapperMessage::PointerMove},
|
||||
entry! {action=DocumentMessage::RotateDown{snap:true}, key_down=Mmb, modifiers=[KeyControl, KeyShift]},
|
||||
entry! {action=DocumentMessage::RotateDown{snap:false}, key_down=Mmb, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::ZoomDown, key_down=Mmb, modifiers=[KeyShift]},
|
||||
entry! {action=DocumentMessage::TranslateDown, key_down=Mmb},
|
||||
entry! {action=DocumentMessage::TransformUp, key_up=Mmb},
|
||||
entry! {action=DocumentMessage::MultiplyZoom(PLUS_KEY_MULTIPLIER), key_down=KeyPlus, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::MultiplyZoom(PLUS_KEY_MULTIPLIER), key_down=KeyEquals, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::MultiplyZoom(MINUS_KEY_MULTIPLIER), key_down=KeyMinus, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::SetZoom(1.), key_down=Key1, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::SetZoom(2.), key_down=Key2, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::WheelZoom, message=InputMapperMessage::MouseScroll, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::WheelTranslate, message=InputMapperMessage::MouseScroll},
|
||||
entry! {action=DocumentMessage::RotateCanvasBegin{snap:true}, key_down=Mmb, modifiers=[KeyControl, KeyShift]},
|
||||
entry! {action=DocumentMessage::RotateCanvasBegin{snap:false}, key_down=Mmb, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::ZoomCanvasBegin, key_down=Mmb, modifiers=[KeyShift]},
|
||||
entry! {action=DocumentMessage::TranslateCanvasBegin, key_down=Mmb},
|
||||
entry! {action=DocumentMessage::TranslateCanvasEnd, key_up=Mmb},
|
||||
entry! {action=DocumentMessage::MultiplyCanvasZoom(PLUS_KEY_ZOOM_MULTIPLIER), key_down=KeyPlus, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::MultiplyCanvasZoom(PLUS_KEY_ZOOM_MULTIPLIER), key_down=KeyEquals, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::MultiplyCanvasZoom(MINUS_KEY_ZOOM_MULTIPLIER), key_down=KeyMinus, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::SetCanvasZoom(1.), key_down=Key1, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::SetCanvasZoom(2.), key_down=Key2, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::WheelCanvasZoom, message=InputMapperMessage::MouseScroll, modifiers=[KeyControl]},
|
||||
entry! {action=DocumentMessage::WheelCanvasTranslate, message=InputMapperMessage::MouseScroll},
|
||||
entry! {action=DocumentMessage::NewDocument, key_down=KeyN, modifiers=[KeyShift]},
|
||||
entry! {action=DocumentMessage::NextDocument, key_down=KeyTab, modifiers=[KeyShift]},
|
||||
entry! {action=DocumentMessage::CloseActiveDocument, key_down=KeyW, modifiers=[KeyShift]},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue