Skip to content

Commit

Permalink
removed dead code for zoomWithScroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratik Agrawal authored and Pratik Agrawal committed Jan 9, 2025
1 parent c1f170a commit 7c7ba7d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 23 deletions.
8 changes: 0 additions & 8 deletions editor/src/messages/frontend/frontend_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,4 @@ pub enum FrontendMessage {
layout_target: LayoutTarget,
diff: Vec<WidgetDiff>,
},
UpdateZoomWithScroll {
#[serde(rename = "zoomWithScroll")]
zoom_with_scroll: bool,
},
UpdateSelectionMode {
#[serde(rename = "selectionMode")]
selection_mode: SelectionMode,
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ impl MessageHandler<PreferencesMessage, ()> for PreferencesMessageHandler {
true => MappingVariant::ZoomWithScroll,
};
responses.add(KeyMappingMessage::ModifyMapping(variant));
responses.add(FrontendMessage::UpdateZoomWithScroll { zoom_with_scroll });
}
PreferencesMessage::SelectionMode { selection_mode } => {
info!("Setting selection mode to: {:?}", selection_mode);
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/state-providers/node-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
UpdateNodeGraphTransform,
UpdateNodeThumbnail,
UpdateWirePathInProgress,
UpdateZoomWithScroll,
} from "@graphite/wasm-communication/messages";

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
Expand All @@ -44,7 +43,6 @@ export function createNodeGraphState(editor: Editor) {
inputTypeDescriptions: new Map<string, string>(),
nodeDescriptions: new Map<string, string>(),
nodeTypes: [] as FrontendNodeType[],
zoomWithScroll: false as boolean,
thumbnails: new Map<bigint, string>(),
selected: [] as bigint[],
transform: { scale: 1, x: 0, y: 0 },
Expand Down Expand Up @@ -136,12 +134,6 @@ export function createNodeGraphState(editor: Editor) {
return state;
});
});
editor.subscriptions.subscribeJsMessage(UpdateZoomWithScroll, (updateZoomWithScroll) => {
update((state) => {
state.zoomWithScroll = updateZoomWithScroll.zoomWithScroll;
return state;
});
});
return {
subscribe,
};
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/wasm-communication/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ export class UpdateWirePathInProgress extends JsMessage {
readonly wirePath!: WirePath | undefined;
}

export class UpdateZoomWithScroll extends JsMessage {
readonly zoomWithScroll!: boolean;
}


// Allows the auto save system to use a string for the id rather than a BigInt.
// IndexedDb does not allow for BigInts as primary keys.
// TypeScript does not allow subclasses to change the type of class variables in subclasses.
Expand Down Expand Up @@ -1629,6 +1624,5 @@ export const messageMakers: Record<string, MessageMaker> = {
UpdateToolShelfLayout,
UpdateWirePathInProgress,
UpdateWorkingColorsLayout,
UpdateZoomWithScroll,
} as const;
export type JsMessageType = keyof typeof messageMakers;

0 comments on commit 7c7ba7d

Please sign in to comment.