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