Shapes: Tools bar Tool Creates Shape / Mask and Fill / Stroke Options (#227)
The Tools bar had Fill and Stroke swatches and a Stroke Width, kept in the interface only, so agents couldn't set them and new shapes could only be a solid fill with a solid stroke. As in After Effects: - With a shape layer selected and a shape tool or the Pen active, Tool Creates Shape / Tool Creates Mask choose whether drawing adds shapes to the layer or masks on it (Fill and Stroke hide while drawing masks). - Clicking the word "Fill" or "Stroke" opens Fill Options / Stroke Options: None, Solid Color, Linear Gradient or Radial Gradient, the blend mode and the opacity. The swatches show the kind; Alt-click steps through the kinds. - New shapes and Pen paths are painted with them: a Gradient Fill or Gradient Stroke across the shape for the gradient kinds. The options are engine state (EditorState.shape_tool) set with the new shape.toolOptions command; shape.newShape and shape.newPath use them unless given paint parameters (which now include fillType, fillBlend, fillOpacity and their stroke twins; layer.newShape takes them too). A Pen path without paint parameters now takes the Tools bar's stroke (none by default) instead of a fixed 2 px white one. layer.addMask also draws rounded rectangle, polygon and star masks, so every shape tool makes a mask on a selected footage or solid layer (rounded rectangles, polygons and stars made a new shape layer). Test: shape_tool_options_paint_new_shapes, masks_of_every_shape_tool_kind, tool_creates_mask_draws_a_mask_on_the_selected_shape_layer, fill_options_paint_the_next_shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0048569682
commit
89e075d1b1
@@ -633,13 +633,7 @@ pub struct UiState {
|
||||
/// Effects & Presets contents-menu view options.
|
||||
#[serde(default)]
|
||||
pub effects_view: EffectsView,
|
||||
/// Shape tool options.
|
||||
pub fill_color: [f32; 3],
|
||||
pub stroke_color: [f32; 3],
|
||||
pub stroke_width: f32,
|
||||
pub snapping: bool,
|
||||
/// Tool creates shape (true) or mask (false) when a layer is selected.
|
||||
pub tool_creates_shape: bool,
|
||||
pub start_screen: bool,
|
||||
/// The Home screen shows its Learn tab (tutorials) instead of the recent projects.
|
||||
#[serde(default)]
|
||||
@@ -714,11 +708,7 @@ impl Default for UiState {
|
||||
effects_favorites: BTreeSet::new(),
|
||||
effects_recent: Vec::new(),
|
||||
effects_view: EffectsView::default(),
|
||||
fill_color: [0.24, 0.55, 0.96],
|
||||
stroke_color: [1.0, 1.0, 1.0],
|
||||
stroke_width: 0.0,
|
||||
snapping: true,
|
||||
tool_creates_shape: true,
|
||||
start_screen: false,
|
||||
home_learn: false,
|
||||
home_templates: false,
|
||||
|
||||
Reference in New Issue
Block a user