Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
#
# Development Environment:
# - Provides all necessary tools for Rust/Wasm development
# - Includes dependencies for desktop app development
# - Sets up profiling and debugging tools
# - Configures mold as the default linker for faster builds
#
# Usage:
# - Development shell: `nix develop`
# - Development shell: `nix develop .nix` from the project root
# - Run in dev shell with direnv: add `use flake` to .envrc
{
description = "Development environment and build configuration";
Expand Down
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ graphite-editor = { path = "../editor", features = [
"ron",
"vello",
] }
graphene-std = { workspace = true }
graph-craft = { workspace = true }
wgpu-executor = { workspace = true }

Expand All @@ -34,3 +35,5 @@ dirs = { workspace = true }
ron = { workspace = true}
bytemuck = { workspace = true }
glam = { workspace = true }
vello = { workspace = true }
derivative = { workspace = true }
17 changes: 13 additions & 4 deletions desktop/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ impl WinitApp {
self.send_messages_to_editor(responses);
}

fn send_messages_to_editor(&mut self, responses: Vec<FrontendMessage>) {
fn send_messages_to_editor(&mut self, mut responses: Vec<FrontendMessage>) {
for message in responses.extract_if(.., |m| matches!(m, FrontendMessage::RenderOverlays(_))) {
let FrontendMessage::RenderOverlays(overlay_context) = message else { unreachable!() };
if let Some(graphics_state) = &mut self.graphics_state {
let scene = overlay_context.take_scene();
graphics_state.set_overlays_scene(scene);
}
}

if responses.is_empty() {
return;
}
Expand Down Expand Up @@ -110,8 +118,8 @@ impl ApplicationHandler<CustomEvent> for WinitApp {
match event {
CustomEvent::UiUpdate(texture) => {
if let Some(graphics_state) = self.graphics_state.as_mut() {
graphics_state.bind_ui_texture(&texture);
graphics_state.resize(texture.width(), texture.height());
graphics_state.bind_ui_texture(texture);
}
if let Some(window) = &self.window {
window.request_redraw();
Expand All @@ -125,7 +133,7 @@ impl ApplicationHandler<CustomEvent> for WinitApp {
}
}
CustomEvent::MessageReceived { message } => {
if let Message::InputPreprocessor(ipp_message) = &message {
if let Message::InputPreprocessor(_) = &message {
if let Some(window) = &self.window {
window.request_redraw();
}
Expand All @@ -144,13 +152,14 @@ impl ApplicationHandler<CustomEvent> for WinitApp {
panic!("graphics state not intialized, viewport offset might be lost");
}
}

self.dispatch_message(message);
}
CustomEvent::NodeGraphRan { texture } => {
if let Some(texture) = texture
&& let Some(graphics_state) = &mut self.graphics_state
{
graphics_state.bind_viewport_texture(&texture);
graphics_state.bind_viewport_texture(texture);
}
let mut responses = VecDeque::new();
let err = self.editor.poll_node_graph_evaluation(&mut responses);
Expand Down
Loading
Loading