Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GraphiteEditor/Graphite
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2981512568d1bcae4932a0ebe90077be17950bea
Choose a base ref
..
head repository: GraphiteEditor/Graphite
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9f865c436ad6d60bd8a13523d72513a4706651aa
Choose a head ref
Showing with 7 additions and 7 deletions.
  1. +3 −3 editor/src/messages/tool/tool_messages/text_tool.rs
  2. +2 −2 frontend/src/io-managers/input.ts
  3. +2 −2 frontend/wasm/src/editor_api.rs
6 changes: 3 additions & 3 deletions editor/src/messages/tool/tool_messages/text_tool.rs
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ pub enum TextToolMessage {
Interact,
PointerMove { center: Key, lock_ratio: Key },
PointerOutsideViewport { center: Key, lock_ratio: Key },
TextChange { new_text: String, is_right_click: bool },
TextChange { new_text: String, is_left_or_right_click: bool },
UpdateBounds { new_text: String },
UpdateOptions(TextOptionsUpdate),
}
@@ -577,10 +577,10 @@ impl Fsm for TextToolFsmState {
responses.add(FrontendMessage::TriggerTextCommit);
TextToolFsmState::Editing
}
(TextToolFsmState::Editing, TextToolMessage::TextChange { new_text, is_right_click }) => {
(TextToolFsmState::Editing, TextToolMessage::TextChange { new_text, is_left_or_right_click }) => {
tool_data.new_text = new_text;

if !is_right_click {
if !is_left_or_right_click {
tool_data.set_editing(false, font_cache, responses);

responses.add(NodeGraphMessage::SetInput {
4 changes: 2 additions & 2 deletions frontend/src/io-managers/input.ts
Original file line number Diff line number Diff line change
@@ -172,8 +172,8 @@ export function createInputManager(editor: Editor, dialog: DialogState, portfoli
}

if (!inTextInput && !inContextMenu) {
const isRightClick = e.button === 2;
if (textToolInteractiveInputElement) editor.handle.onChangeText(textInputCleanup(textToolInteractiveInputElement.innerText), isRightClick);
const isLeftOrRightClick = e.button === 2 || e.button === 0;
if (textToolInteractiveInputElement) editor.handle.onChangeText(textInputCleanup(textToolInteractiveInputElement.innerText), isLeftOrRightClick);
else viewportPointerInteractionOngoing = isTargetingCanvas instanceof Element;
}

4 changes: 2 additions & 2 deletions frontend/wasm/src/editor_api.rs
Original file line number Diff line number Diff line change
@@ -433,8 +433,8 @@ impl EditorHandle {

/// A text box was committed
#[wasm_bindgen(js_name = onChangeText)]
pub fn on_change_text(&self, new_text: String, is_right_click: bool) -> Result<(), JsValue> {
let message = TextToolMessage::TextChange { new_text, is_right_click };
pub fn on_change_text(&self, new_text: String, is_left_or_right_click: bool) -> Result<(), JsValue> {
let message = TextToolMessage::TextChange { new_text, is_left_or_right_click };
self.dispatch(message);

Ok(())