feat: add star sparkle brush preset and enhance star brush parameters
This commit is contained in:
@@ -587,6 +587,12 @@ pub struct ToolState {
|
||||
pub brush_color_variant: bool,
|
||||
/// Magnitude of the per-dab color variation (0.0..1.0).
|
||||
pub brush_variant_amount: f32,
|
||||
/// Star brush base rotation angle in radians.
|
||||
pub brush_angle: f32,
|
||||
/// Star brush per-dab size variance (0.0..1.0).
|
||||
pub brush_size_variance: f32,
|
||||
/// Star brush per-dab angle variance (0.0..1.0).
|
||||
pub brush_angle_variance: f32,
|
||||
/// True when the brush color should cycle through the hue over stroke distance.
|
||||
pub brush_cyclic_color: bool,
|
||||
/// Speed of the hue cycle along the stroke (0.01..5.0).
|
||||
@@ -625,6 +631,9 @@ impl Default for ToolState {
|
||||
brush_spacing: 1.0,
|
||||
brush_color_variant: false,
|
||||
brush_variant_amount: 0.0,
|
||||
brush_angle: 0.0,
|
||||
brush_size_variance: 0.0,
|
||||
brush_angle_variance: 0.0,
|
||||
brush_cyclic_color: false,
|
||||
brush_cyclic_speed: 0.5,
|
||||
last_update_instant: std::time::Instant::now(),
|
||||
@@ -784,6 +793,9 @@ pub enum Message {
|
||||
BrushSpacingChanged(f32),
|
||||
BrushColorVariantToggled(bool),
|
||||
BrushVariantAmountChanged(f32),
|
||||
BrushAngleChanged(f32),
|
||||
BrushSizeVarianceChanged(f32),
|
||||
BrushAngleVarianceChanged(f32),
|
||||
BrushCyclicColorToggled(bool),
|
||||
BrushCyclicSpeedChanged(f32),
|
||||
BrushImportAbr,
|
||||
@@ -1323,6 +1335,9 @@ fn build_brush_tip(state: &ToolState) -> BrushTip {
|
||||
spacing: state.brush_spacing,
|
||||
color_variant: state.brush_color_variant,
|
||||
variant_amount: state.brush_variant_amount,
|
||||
angle: state.brush_angle,
|
||||
roundness: state.brush_size_variance,
|
||||
rotation_random: state.brush_angle_variance,
|
||||
..BrushTip::default()
|
||||
}
|
||||
}
|
||||
@@ -4976,6 +4991,21 @@ impl HcieIcedApp {
|
||||
self.settings.update_from_tool_state(&self.tool_state);
|
||||
let _ = self.settings.save();
|
||||
}
|
||||
Message::BrushAngleChanged(angle) => {
|
||||
self.tool_state.brush_angle = angle;
|
||||
self.settings.update_from_tool_state(&self.tool_state);
|
||||
let _ = self.settings.save();
|
||||
}
|
||||
Message::BrushSizeVarianceChanged(variance) => {
|
||||
self.tool_state.brush_size_variance = variance;
|
||||
self.settings.update_from_tool_state(&self.tool_state);
|
||||
let _ = self.settings.save();
|
||||
}
|
||||
Message::BrushAngleVarianceChanged(variance) => {
|
||||
self.tool_state.brush_angle_variance = variance;
|
||||
self.settings.update_from_tool_state(&self.tool_state);
|
||||
let _ = self.settings.save();
|
||||
}
|
||||
Message::BrushCyclicColorToggled(enabled) => {
|
||||
self.tool_state.brush_cyclic_color = enabled;
|
||||
self.documents[self.active_doc]
|
||||
|
||||
Reference in New Issue
Block a user