Add the SVG Preview render mode in place of the Vello option in the preferences (#3797)

* Remove Vello from preferences

* Add the Render Mode: SVG Preview radio button

* Remove SVG outline renderer

* Add a tooltip explaination when disabled in unsupported browsers

* Fix Eyedropper tool to support Outline render mode

* Use #[allow(clippy::too_many_arguments)] instead of tuple

* Rerun nodegraph when max render area is changed

---------

Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
Keavon Chambers
2026-02-22 20:27:26 +00:00
committed by GitHub
co-authored by Dennis Kobert
parent a2d3b3f410
commit 9f2c8713ff
16 changed files with 102 additions and 169 deletions
@@ -10,7 +10,6 @@ pub enum PreferencesMessage {
ResetToDefaults,
// Per-preference messages
VelloPreference { preference: graph_craft::wasm_application_io::VelloPreference },
SelectionMode { selection_mode: SelectionMode },
BrushTool { enabled: bool },
ModifyLayout { zoom_with_scroll: bool },
@@ -5,7 +5,6 @@ use crate::messages::preferences::SelectionMode;
use crate::messages::prelude::*;
use crate::messages::tool::utility_types::ToolType;
use graph_craft::wasm_application_io::EditorPreferences;
use graphene_std::application_io::GetEditorPreferences;
#[derive(ExtractField)]
pub struct PreferencesMessageContext<'a> {
@@ -17,7 +16,6 @@ pub struct PreferencesMessageContext<'a> {
pub struct PreferencesMessageHandler {
pub selection_mode: SelectionMode,
pub zoom_with_scroll: bool,
pub vello_preference: graph_craft::wasm_application_io::VelloPreference,
pub brush_tool: bool,
pub graph_wire_style: GraphWireStyle,
pub viewport_zoom_wheel_rate: f64,
@@ -37,7 +35,6 @@ impl PreferencesMessageHandler {
pub fn editor_preferences(&self) -> EditorPreferences {
EditorPreferences {
vello_preference: self.vello_preference,
max_render_region_size: self.max_render_region_size,
}
}
@@ -45,10 +42,6 @@ impl PreferencesMessageHandler {
pub fn supports_wgpu(&self) -> bool {
graph_craft::wasm_application_io::wgpu_available().unwrap_or_default()
}
pub fn use_vello(&self) -> bool {
self.editor_preferences().use_vello()
}
}
impl Default for PreferencesMessageHandler {
@@ -56,7 +49,6 @@ impl Default for PreferencesMessageHandler {
Self {
selection_mode: SelectionMode::Touched,
zoom_with_scroll: matches!(MappingVariant::default(), MappingVariant::ZoomWithScroll),
vello_preference: EditorPreferences::default().vello_preference,
brush_tool: false,
graph_wire_style: GraphWireStyle::default(),
viewport_zoom_wheel_rate: VIEWPORT_ZOOM_WHEEL_RATE,
@@ -78,7 +70,6 @@ impl MessageHandler<PreferencesMessage, PreferencesMessageContext<'_>> for Prefe
*self = preferences;
responses.add(PortfolioMessage::EditorPreferences);
responses.add(PortfolioMessage::UpdateVelloPreference);
responses.add(PreferencesMessage::ModifyLayout {
zoom_with_scroll: self.zoom_with_scroll,
});
@@ -90,12 +81,6 @@ impl MessageHandler<PreferencesMessage, PreferencesMessageContext<'_>> for Prefe
}
// Per-preference messages
PreferencesMessage::VelloPreference { preference } => {
self.vello_preference = preference;
responses.add(PortfolioMessage::UpdateVelloPreference);
responses.add(PortfolioMessage::EditorPreferences);
responses.add(PreferencesDialogMessage::Update);
}
PreferencesMessage::BrushTool { enabled } => {
self.brush_tool = enabled;
@@ -131,8 +116,8 @@ impl MessageHandler<PreferencesMessage, PreferencesMessageContext<'_>> for Prefe
}
PreferencesMessage::MaxRenderRegionSize { size } => {
self.max_render_region_size = size;
responses.add(PortfolioMessage::UpdateVelloPreference);
responses.add(PortfolioMessage::EditorPreferences);
responses.add(NodeGraphMessage::RunDocumentGraph);
}
}