Skip to content

Commit c0bddf4

Browse files
authored
Merge branch 'master' into zoom
2 parents 9d41a45 + 6a8386d commit c0bddf4

File tree

309 files changed

+7692
-3710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+7692
-3710
lines changed

.github/workflows/build-dev-and-ci.yml

-11
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,6 @@ jobs:
108108
- name: 📥 Clone and checkout repository
109109
uses: actions/checkout@v3
110110

111-
- name: 🔒 Check crate security advisories for root workspace
112-
uses: EmbarkStudios/cargo-deny-action@v2
113-
with:
114-
command: check advisories
115-
116-
- name: 🔒 Check crate security advisories for /libraries/rawkit
117-
uses: EmbarkStudios/cargo-deny-action@v2
118-
with:
119-
command: check advisories
120-
manifest-path: libraries/rawkit/Cargo.toml
121-
122111
- name: 📜 Check crate license compatibility for root workspace
123112
uses: EmbarkStudios/cargo-deny-action@v2
124113
with:

.github/workflows/cargo-deny.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Audit Security Advisories"
2+
3+
on:
4+
# Run once each day
5+
schedule:
6+
- cron: "0 0 * * *"
7+
8+
jobs:
9+
cargo-deny:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: 📥 Clone and checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: 🔒 Check crate security advisories for root workspace
17+
uses: EmbarkStudios/cargo-deny-action@v2
18+
with:
19+
command: check advisories
20+
21+
- name: 🔒 Check crate security advisories for /libraries/rawkit
22+
uses: EmbarkStudios/cargo-deny-action@v2
23+
with:
24+
command: check advisories
25+
manifest-path: libraries/rawkit/Cargo.toml

Cargo.lock

+25-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ syn = { version = "2.0", default-features = false, features = [
9595
"derive",
9696
] }
9797
kurbo = { version = "0.11.0", features = ["serde"] }
98+
petgraph = { version = "0.7.1", default-features = false, features = [
99+
"graphmap",
100+
] }
98101

99102
[profile.dev]
100103
opt-level = 1

demo-artwork/isometric-fountain.graphite

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/parametric-dunescape.graphite

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deny.toml

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ ignore = [
4747
"RUSTSEC-2024-0388", # Unmaintained but still fully functional crate `derivative`
4848
"RUSTSEC-2025-0007", # Unmaintained but still fully functional crate `ring`
4949
"RUSTSEC-2024-0436", # Unmaintained but still fully functional crate `paste`
50+
"RUSTSEC-2025-0014", # Unmaintained but still fully functional crate `humantime`
5051
]
5152
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
5253
# lower than the range specified will be ignored. Note that ignored advisories

editor/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
name = "graphite-editor"
33
publish = false
44
version = "0.0.0"
5-
rust-version = "1.82"
5+
rust-version = "1.85"
66
authors = ["Graphite Authors <contact@graphite.rs>"]
7-
edition = "2021"
7+
edition = "2024"
88
readme = "../README.md"
99
homepage = "https://graphite.rs"
1010
repository = "https://github.com/GraphiteEditor/Graphite"

editor/src/application.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::dispatcher::Dispatcher;
22
use crate::messages::prelude::*;
3-
43
pub use graphene_core::uuid::*;
54

65
// TODO: serialize with serde to save the current editor state

editor/src/dispatcher.rs

+19-12
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub struct Dispatcher {
1313

1414
#[derive(Debug, Default)]
1515
pub struct DispatcherMessageHandlers {
16+
animation_message_handler: AnimationMessageHandler,
1617
broadcast_message_handler: BroadcastMessageHandler,
1718
debug_message_handler: DebugMessageHandler,
1819
dialog_message_handler: DialogMessageHandler,
@@ -50,12 +51,9 @@ const SIDE_EFFECT_FREE_MESSAGES: &[MessageDiscriminant] = &[
5051
MessageDiscriminant::Frontend(FrontendMessageDiscriminant::UpdateDocumentLayerStructure),
5152
MessageDiscriminant::Frontend(FrontendMessageDiscriminant::TriggerFontLoad),
5253
];
53-
const DEBUG_MESSAGE_BLOCK_LIST: &[MessageDiscriminant] = &[
54-
MessageDiscriminant::Broadcast(BroadcastMessageDiscriminant::TriggerEvent(BroadcastEventDiscriminant::AnimationFrame)),
55-
MessageDiscriminant::InputPreprocessor(InputPreprocessorMessageDiscriminant::FrameTimeAdvance),
56-
];
54+
const DEBUG_MESSAGE_BLOCK_LIST: &[MessageDiscriminant] = &[MessageDiscriminant::Broadcast(BroadcastMessageDiscriminant::TriggerEvent(BroadcastEventDiscriminant::AnimationFrame))];
5755
// TODO: Find a way to combine these with the list above. We use strings for now since these are the standard variant names used by multiple messages. But having these also type-checked would be best.
58-
const DEBUG_MESSAGE_ENDING_BLOCK_LIST: &[&str] = &["PointerMove", "PointerOutsideViewport", "Overlays", "Draw"];
56+
const DEBUG_MESSAGE_ENDING_BLOCK_LIST: &[&str] = &["PointerMove", "PointerOutsideViewport", "Overlays", "Draw", "CurrentTime", "Time"];
5957

6058
impl Dispatcher {
6159
pub fn new() -> Self {
@@ -141,14 +139,18 @@ impl Dispatcher {
141139
};
142140

143141
let graphene_std::renderer::RenderMetadata {
144-
footprints,
142+
upstream_footprints: footprints,
143+
local_transforms,
145144
click_targets,
146145
clip_targets,
147146
} = render_metadata;
148147

149148
// Run these update state messages immediately
150149
let messages = [
151-
DocumentMessage::UpdateUpstreamTransforms { upstream_transforms: footprints },
150+
DocumentMessage::UpdateUpstreamTransforms {
151+
upstream_footprints: footprints,
152+
local_transforms,
153+
},
152154
DocumentMessage::UpdateClickTargets { click_targets },
153155
DocumentMessage::UpdateClipTargets { clip_targets },
154156
];
@@ -173,6 +175,9 @@ impl Dispatcher {
173175
// Finish loading persistent data from the browser database
174176
queue.add(FrontendMessage::TriggerLoadRestAutoSaveDocuments);
175177
}
178+
Message::Animation(message) => {
179+
self.message_handlers.animation_message_handler.process_message(message, &mut queue, ());
180+
}
176181
Message::Batched(messages) => {
177182
messages.iter().for_each(|message| self.handle_message(message.to_owned(), false));
178183
}
@@ -228,6 +233,8 @@ impl Dispatcher {
228233
let preferences = &self.message_handlers.preferences_message_handler;
229234
let current_tool = &self.message_handlers.tool_message_handler.tool_state.tool_data.active_tool_type;
230235
let message_logging_verbosity = self.message_handlers.debug_message_handler.message_logging_verbosity;
236+
let timing_information = self.message_handlers.animation_message_handler.timing_information();
237+
let animation = &self.message_handlers.animation_message_handler;
231238

232239
self.message_handlers.portfolio_message_handler.process_message(
233240
message,
@@ -237,6 +244,8 @@ impl Dispatcher {
237244
preferences,
238245
current_tool,
239246
message_logging_verbosity,
247+
timing_information,
248+
animation,
240249
},
241250
);
242251
}
@@ -279,6 +288,7 @@ impl Dispatcher {
279288
// TODO: Reduce the number of heap allocations
280289
let mut list = Vec::new();
281290
list.extend(self.message_handlers.dialog_message_handler.actions());
291+
list.extend(self.message_handlers.animation_message_handler.actions());
282292
list.extend(self.message_handlers.input_preprocessor_message_handler.actions());
283293
list.extend(self.message_handlers.key_mapping_message_handler.actions());
284294
list.extend(self.message_handlers.debug_message_handler.actions());
@@ -299,11 +309,7 @@ impl Dispatcher {
299309
fn create_indents(queues: &[VecDeque<Message>]) -> String {
300310
String::from_iter(queues.iter().enumerate().skip(1).map(|(index, queue)| {
301311
if index == queues.len() - 1 {
302-
if queue.is_empty() {
303-
"└── "
304-
} else {
305-
"├── "
306-
}
312+
if queue.is_empty() { "└── " } else { "├── " }
307313
} else if queue.is_empty() {
308314
" "
309315
} else {
@@ -509,6 +515,7 @@ mod test {
509515
// include_str!("../../demo-artwork/isometric-fountain.graphite"),
510516
// include_str!("../../demo-artwork/painted-dreams.graphite"),
511517
// include_str!("../../demo-artwork/procedural-string-lights.graphite"),
518+
// include_str!("../../demo-artwork/parametric-dunescape.graphite"),
512519
// include_str!("../../demo-artwork/red-dress.graphite"),
513520
// include_str!("../../demo-artwork/valley-of-spires.graphite"),
514521
// ];

editor/src/macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/// ```
2626
///
2727
macro_rules! actions {
28-
($($v:expr),* $(,)?) => {{
28+
($($v:expr_2021),* $(,)?) => {{
2929
vec![$(vec![$v.into()]),*]
3030
}};
3131

@@ -42,7 +42,7 @@ macro_rules! actions {
4242
/// }
4343
/// ```
4444
macro_rules! advertise_actions {
45-
($($v:expr),* $(,)?) => {
45+
($($v:expr_2021),* $(,)?) => {
4646
fn actions(&self) -> $crate::utility_traits::ActionList {
4747
actions!($($v),*)
4848
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use crate::messages::prelude::*;
2+
3+
use super::animation_message_handler::AnimationTimeMode;
4+
5+
#[impl_message(Message, Animation)]
6+
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
7+
pub enum AnimationMessage {
8+
ToggleLivePreview,
9+
EnableLivePreview,
10+
DisableLivePreview,
11+
RestartAnimation,
12+
SetFrameIndex(f64),
13+
SetTime(f64),
14+
UpdateTime,
15+
IncrementFrameCounter,
16+
SetAnimationTimeMode(AnimationTimeMode),
17+
}

0 commit comments

Comments
 (0)