Skip to content

Commit f6587ca

Browse files
authored
Merge branch 'master' into Clear-Artboards
2 parents 6589d9b + 93a60da commit f6587ca

File tree

101 files changed

+1048
-790
lines changed

Some content is hidden

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

101 files changed

+1048
-790
lines changed

.github/workflows/comment-clippy-warnings.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ jobs:
99
clippy:
1010
name: Run Clippy
1111
runs-on: ubuntu-latest
12-
if: ${{ !github.event.pull_request.draft }}
12+
# TODO(Keavon): Find a workaround (passing the output text to a separate action with permission to read the secrets?) that allows this to work on fork PRs
13+
if: ${{ !github.event.pull_request.draft && !github.event.pull_request.head.repo.fork }}
1314
permissions:
1415
contents: read
1516
pull-requests: write

.github/workflows/website.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: 🌐 Build Graphite website with Zola
4141
run: |
4242
cd website
43-
zola build
43+
zola --config config_prod.toml build
4444
4545
- name: 🔍 Check if `website/other` directory changed
4646
uses: dorny/paths-filter@v3

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ spirv-std = { git = "https://github.com/Rust-GPU/rust-gpu.git" }
6363
wgpu-types = "23"
6464
wgpu = "23"
6565
once_cell = "1.13" # Remove when `core::cell::LazyCell` (<https://doc.rust-lang.org/core/cell/struct.LazyCell.html>) is stabilized in Rust 1.80 and we bump our MSRV
66-
wasm-bindgen = "=0.2.99" # NOTICE: ensure this stays in sync with the `wasm-bindgen-cli` version in `website/content/volunteer/guide/getting-started/_index.md`. We pin this version because wasm-bindgen upgrades may break various things.
66+
wasm-bindgen = "=0.2.99" # NOTICE: ensure this stays in sync with the `wasm-bindgen-cli` version in `website/content/volunteer/guide/project-setup/_index.md`. We pin this version because wasm-bindgen upgrades may break various things.
6767
wasm-bindgen-futures = "0.4"
6868
js-sys = "=0.3.76"
6969
web-sys = "=0.3.76"

editor/src/dispatcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl Dispatcher {
7777

7878
pub fn handle_message<T: Into<Message>>(&mut self, message: T, process_after_all_current: bool) {
7979
let message = message.into();
80-
// Add all aditional messages to the buffer if it exists (except from the end buffer message)
80+
// Add all additional messages to the buffer if it exists (except from the end buffer message)
8181
if !matches!(message, Message::EndBuffer(_)) {
8282
if let Some(buffered_queue) = &mut self.buffered_queue {
8383
Self::schedule_execution(buffered_queue, true, [message]);

editor/src/messages/frontend/frontend_message.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub enum FrontendMessage {
110110
#[serde(rename = "copyText")]
111111
copy_text: String,
112112
},
113-
// TODO: Eventually remove this (probably starting late 2024)
113+
// TODO: Eventually remove this document upgrade code
114114
TriggerUpgradeDocumentToVectorManipulationFormat {
115115
#[serde(rename = "documentId")]
116116
document_id: DocumentId,
@@ -234,7 +234,7 @@ pub enum FrontendMessage {
234234
#[serde(rename = "hintData")]
235235
hint_data: HintData,
236236
},
237-
UpdateLayersPanelOptionsLayout {
237+
UpdateLayersPanelControlBarLayout {
238238
#[serde(rename = "layoutTarget")]
239239
layout_target: LayoutTarget,
240240
diff: Vec<WidgetDiff>,
@@ -251,7 +251,7 @@ pub enum FrontendMessage {
251251
nodes: Vec<FrontendNode>,
252252
wires: Vec<FrontendNodeWire>,
253253
},
254-
UpdateNodeGraphBarLayout {
254+
UpdateNodeGraphControlBarLayout {
255255
#[serde(rename = "layoutTarget")]
256256
layout_target: LayoutTarget,
257257
diff: Vec<WidgetDiff>,

editor/src/messages/layout/layout_message_handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ impl LayoutMessageHandler {
401401
LayoutTarget::DialogColumn2 => FrontendMessage::UpdateDialogColumn2 { layout_target, diff },
402402
LayoutTarget::DocumentBar => FrontendMessage::UpdateDocumentBarLayout { layout_target, diff },
403403
LayoutTarget::DocumentMode => FrontendMessage::UpdateDocumentModeLayout { layout_target, diff },
404-
LayoutTarget::LayersPanelOptions => FrontendMessage::UpdateLayersPanelOptionsLayout { layout_target, diff },
404+
LayoutTarget::LayersPanelControlBar => FrontendMessage::UpdateLayersPanelControlBarLayout { layout_target, diff },
405405
LayoutTarget::MenuBar => unreachable!("Menu bar is not diffed"),
406-
LayoutTarget::NodeGraphBar => FrontendMessage::UpdateNodeGraphBarLayout { layout_target, diff },
406+
LayoutTarget::NodeGraphControlBar => FrontendMessage::UpdateNodeGraphControlBarLayout { layout_target, diff },
407407
LayoutTarget::PropertiesSections => FrontendMessage::UpdatePropertyPanelSectionsLayout { layout_target, diff },
408408
LayoutTarget::ToolOptions => FrontendMessage::UpdateToolOptionsLayout { layout_target, diff },
409409
LayoutTarget::ToolShelf => FrontendMessage::UpdateToolShelfLayout { layout_target, diff },

editor/src/messages/layout/utility_types/layout_widget.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ pub enum LayoutTarget {
3333
/// Contains the dropdown for design / select / guide mode found on the top left of the canvas.
3434
DocumentMode,
3535
/// Options for opacity seen at the top of the Layers panel.
36-
LayersPanelOptions,
36+
LayersPanelControlBar,
3737
/// The dropdown menu at the very top of the application: File, Edit, etc.
3838
MenuBar,
3939
/// Bar at the top of the node graph containing the location and the "Preview" and "Hide" buttons.
40-
NodeGraphBar,
40+
NodeGraphControlBar,
4141
/// The body of the Properties panel containing many collapsable sections.
4242
PropertiesSections,
4343
/// The bar directly above the canvas, left-aligned and to the right of the document mode dropdown.

editor/src/messages/portfolio/document/document_message_handler.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,10 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
275275
let data_buffer: RawBuffer = Self::default().serialize_root();
276276
responses.add(FrontendMessage::UpdateDocumentLayerStructure { data_buffer });
277277

278-
// Clear the options bar
278+
// Clear the control bar
279279
responses.add(LayoutMessage::SendLayout {
280280
layout: Layout::WidgetLayout(Default::default()),
281-
layout_target: LayoutTarget::LayersPanelOptions,
281+
layout_target: LayoutTarget::LayersPanelControlBar,
282282
});
283283
}
284284
DocumentMessage::InsertBooleanOperation { operation } => {
@@ -350,7 +350,7 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
350350
DocumentMessage::DocumentHistoryBackward => self.undo_with_history(ipp, responses),
351351
DocumentMessage::DocumentHistoryForward => self.redo_with_history(ipp, responses),
352352
DocumentMessage::DocumentStructureChanged => {
353-
self.update_layers_panel_options_bar_widgets(responses);
353+
self.update_layers_panel_control_bar_widgets(responses);
354354

355355
self.network_interface.load_structure();
356356
let data_buffer: RawBuffer = self.serialize_root();
@@ -1903,7 +1903,7 @@ impl DocumentMessageHandler {
19031903
});
19041904
}
19051905

1906-
pub fn update_layers_panel_options_bar_widgets(&self, responses: &mut VecDeque<Message>) {
1906+
pub fn update_layers_panel_control_bar_widgets(&self, responses: &mut VecDeque<Message>) {
19071907
// Get an iterator over the selected layers (excluding artboards which don't have an opacity or blend mode).
19081908
let selected_nodes = self.network_interface.selected_nodes(&[]).unwrap();
19091909
let selected_layers_except_artboards = selected_nodes.selected_layers_except_artboards(&self.network_interface);
@@ -1971,7 +1971,7 @@ impl DocumentMessageHandler {
19711971
.selected_layers(self.metadata())
19721972
.all(|layer| self.network_interface.is_locked(&layer.to_node(), &[]));
19731973

1974-
let layers_panel_options_bar = WidgetLayout::new(vec![LayoutGroup::Row {
1974+
let layers_panel_control_bar = WidgetLayout::new(vec![LayoutGroup::Row {
19751975
widgets: vec![
19761976
DropdownInput::new(blend_mode_menu_entries)
19771977
.selected_index(blend_mode.and_then(|blend_mode| blend_mode.index_in_list_svg_subset()).map(|index| index as u32))
@@ -2039,8 +2039,8 @@ impl DocumentMessageHandler {
20392039
}]);
20402040

20412041
responses.add(LayoutMessage::SendLayout {
2042-
layout: Layout::WidgetLayout(layers_panel_options_bar),
2043-
layout_target: LayoutTarget::LayersPanelOptions,
2042+
layout: Layout::WidgetLayout(layers_panel_control_bar),
2043+
layout_target: LayoutTarget::LayersPanelControlBar,
20442044
});
20452045
}
20462046

@@ -2297,7 +2297,7 @@ impl Iterator for ClickXRayIter<'_> {
22972297
}
22982298
}
22992299

2300-
// TODO: Eventually remove this (probably starting late 2024)
2300+
// TODO: Eventually remove this document upgrade code
23012301
#[derive(Debug, serde::Serialize, serde::Deserialize)]
23022302
pub struct OldDocumentMessageHandler {
23032303
// ============================================

editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,11 +1642,11 @@ impl NodeGraphMessageHandler {
16421642
common
16431643
}
16441644

1645-
/// Send the cached layout to the frontend for the options bar at the top of the node panel
1645+
/// Send the cached layout to the frontend for the control bar at the top of the node panel
16461646
fn send_node_bar_layout(&self, responses: &mut VecDeque<Message>) {
16471647
responses.add(LayoutMessage::SendLayout {
16481648
layout: Layout::WidgetLayout(WidgetLayout::new(self.widgets.to_vec())),
1649-
layout_target: LayoutTarget::NodeGraphBar,
1649+
layout_target: LayoutTarget::NodeGraphControlBar,
16501650
});
16511651
}
16521652

editor/src/messages/portfolio/document/overlays/grid_overlays.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ fn grid_overlay_isometric_dot(document: &DocumentMessageHandler, overlay_context
183183
document_to_viewport.transform_point2(start),
184184
document_to_viewport.transform_point2(end),
185185
Some(&("#".to_string() + &grid_color.rgba_hex())),
186-
Some((spacing_x / cos_a) * document_to_viewport.matrix2.x_axis.length()),
186+
Some(1.),
187+
Some((spacing_x / cos_a) * document_to_viewport.matrix2.x_axis.length() - 1.),
187188
None,
188189
);
189190
}

0 commit comments

Comments
 (0)