mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-03 23:18:11 +08:00
fixup
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
use winit::event_loop::ActiveEventLoop;
|
use winit::event_loop::ActiveEventLoop;
|
||||||
use winit::window::{Window, WindowAttributes};
|
|
||||||
use winit::platform::macos::{OptionAsAlt, WindowAttributesMacOS};
|
use winit::platform::macos::{OptionAsAlt, WindowAttributesMacOS};
|
||||||
|
use winit::window::{Window, WindowAttributes};
|
||||||
|
|
||||||
use crate::consts::APP_NAME;
|
use crate::consts::APP_NAME;
|
||||||
use crate::event::AppEventScheduler;
|
use crate::event::AppEventScheduler;
|
||||||
|
|||||||
@@ -37,13 +37,16 @@ impl MessageHandler<ViewportMessage, ()> for ViewportMessageHandler {
|
|||||||
ViewportMessage::RepropagateUpdate => {}
|
ViewportMessage::RepropagateUpdate => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
let physical_bounds = self.bounds().to_physical();
|
#[cfg(not(target_family = "wasm"))]
|
||||||
responses.add(FrontendMessage::UpdateViewportPhysicalBounds {
|
{
|
||||||
x: physical_bounds.x(),
|
let physical_bounds = self.bounds().to_physical();
|
||||||
y: physical_bounds.y(),
|
responses.add(FrontendMessage::UpdateViewportPhysicalBounds {
|
||||||
width: physical_bounds.width(),
|
x: physical_bounds.x(),
|
||||||
height: physical_bounds.height(),
|
y: physical_bounds.y(),
|
||||||
});
|
width: physical_bounds.width(),
|
||||||
|
height: physical_bounds.height(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
responses.add(NavigationMessage::CanvasPan { delta: DVec2::ZERO });
|
responses.add(NavigationMessage::CanvasPan { delta: DVec2::ZERO });
|
||||||
responses.add(NodeGraphMessage::SetGridAlignedEdges);
|
responses.add(NodeGraphMessage::SetGridAlignedEdges);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
TriggerLoadFirstAutoSaveDocument,
|
TriggerLoadFirstAutoSaveDocument,
|
||||||
TriggerLoadRestAutoSaveDocuments,
|
TriggerLoadRestAutoSaveDocuments,
|
||||||
TriggerSaveActiveDocument,
|
TriggerSaveActiveDocument,
|
||||||
|
TriggerOpenLaunchDocuments,
|
||||||
} from "@graphite/messages";
|
} from "@graphite/messages";
|
||||||
import { type PortfolioState } from "@graphite/state-providers/portfolio";
|
import { type PortfolioState } from "@graphite/state-providers/portfolio";
|
||||||
|
|
||||||
@@ -171,6 +172,9 @@ export function createPersistenceManager(editor: Editor, portfolio: PortfolioSta
|
|||||||
editor.subscriptions.subscribeJsMessage(TriggerLoadRestAutoSaveDocuments, async () => {
|
editor.subscriptions.subscribeJsMessage(TriggerLoadRestAutoSaveDocuments, async () => {
|
||||||
await loadRestDocuments();
|
await loadRestDocuments();
|
||||||
});
|
});
|
||||||
|
editor.subscriptions.subscribeJsMessage(TriggerOpenLaunchDocuments, async () => {
|
||||||
|
// TODO: Could be used to load documents from URL params or similar on launch
|
||||||
|
});
|
||||||
editor.subscriptions.subscribeJsMessage(TriggerSaveActiveDocument, async (triggerSaveActiveDocument) => {
|
editor.subscriptions.subscribeJsMessage(TriggerSaveActiveDocument, async (triggerSaveActiveDocument) => {
|
||||||
const documentId = String(triggerSaveActiveDocument.documentId);
|
const documentId = String(triggerSaveActiveDocument.documentId);
|
||||||
const previouslySavedDocuments = await get<Record<string, TriggerPersistenceWriteDocument>>("documents", graphiteStore);
|
const previouslySavedDocuments = await get<Record<string, TriggerPersistenceWriteDocument>>("documents", graphiteStore);
|
||||||
|
|||||||
Reference in New Issue
Block a user