Fix regressions introduced in the vector nodes migration (#1100)

* Fix double click to enter path tool

* Fix error

* Fix transform bug

* Fix squaring scale on images

* Shift node position and refresh graph

* Downscale node seperate

* Fix mirror

* Remove duplicate transform

* Always show node graph

* Correctly set freehand and spline tool positions

* Run cargo format

* Maybe fix the scale

* Downscaled image is always smaller than origional

* Fix one crash

* Don't show node graph on welcome screen

* Reduce default graph panel height

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2023-03-31 21:15:49 +01:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent 92fe0bea50
commit d710285029
23 changed files with 105 additions and 118 deletions
@@ -14,8 +14,8 @@
const PANEL_SIZES = {
/**/ root: 100,
/* ├── */ content: 80,
/* │ ├── */ document: 60,
/* │ └── */ graph: 40,
/* │ ├── */ document: 80,
/* │ └── */ graph: 20,
/* └── */ details: 20,
/* ├── */ properties: 45,
/* └── */ layers: 55,
@@ -111,7 +111,7 @@
bind:this={documentPanel}
/>
</LayoutRow>
{#if $workspace.nodeGraphVisible}
{#if $portfolio.documents.length > 0}
<LayoutRow class="workspace-grid-resize-gutter" data-gutter-vertical on:pointerdown={resizePanel} />
<LayoutRow class="workspace-grid-subdivision" styles={{ "flex-grow": panelSizes["graph"] }} data-subdivision-name="graph">
<Panel panelType="NodeGraph" tabLabels={[{ name: "Node Graph" }]} tabActiveIndex={0} />
+2 -15
View File
@@ -1,28 +1,15 @@
/* eslint-disable max-classes-per-file */
import {tick} from "svelte";
import {writable} from "svelte/store";
import { type Editor } from "@graphite/wasm-communication/editor";
import { UpdateNodeGraphVisibility } from "@graphite/wasm-communication/messages";
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export function createWorkspaceState(editor: Editor) {
const { subscribe, update } = writable({
nodeGraphVisible: false,
});
const { subscribe, update } = writable({});
// Set up message subscriptions on creation
editor.subscriptions.subscribeJsMessage(UpdateNodeGraphVisibility, async (updateNodeGraphVisibility) => {
update((state) => {
state.nodeGraphVisible = updateNodeGraphVisibility.visible;
return state;
});
// Update the viewport bounds
await tick();
window.dispatchEvent(new Event("resize"));
});
return {
subscribe,
@@ -44,9 +44,6 @@ export class UpdateNodeGraphSelection extends JsMessage {
readonly selected!: bigint[];
}
export class UpdateNodeGraphVisibility extends JsMessage {
readonly visible!: boolean;
}
export class UpdateOpenDocumentsList extends JsMessage {
@Type(() => FrontendDocumentDetails)
@@ -1432,7 +1429,6 @@ export const messageMakers: Record<string, MessageMaker> = {
UpdateNodeGraphBarLayout,
UpdateNodeGraphSelection,
UpdateNodeTypes,
UpdateNodeGraphVisibility,
UpdateOpenDocumentsList,
UpdatePropertyPanelOptionsLayout,
UpdatePropertyPanelSectionsLayout,