mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-08 19:42:05 +00:00
Region fills: say it in our own words; one row per item after the merge
This commit is contained in:
1 parent
2410a94091
commit
16ae1b2273
5 files changed
+5
-9
No files matched your search
@@ -1264,8 +1264,7 @@ pub fn paint_all(doc: &mut Document, id: NodeId, pts: &[Point]) -> Result<bool>
|
||||
/// The fills the Fill section shows for layer `id` while regions of it are selected in edit
|
||||
/// mode: the stack those regions share (their own, else the layer's), `Some(None)` when they
|
||||
/// differ (mixed), `None` when no region of that layer is selected (the layer's fills show). The
|
||||
/// fill commands edit the same regions then ("you can adjust the fill for each region
|
||||
/// individually", Edit vector layers, #1875).
|
||||
/// fill commands edit the same regions then (#1875).
|
||||
pub fn selected_region_fills(s: &Session, id: NodeId) -> Option<Option<Vec<figcraft_color::Paint>>> {
|
||||
let ve = s.ds().ok()?.vector_edit.as_ref().filter(|ve| ve.id == id && !ve.regions.is_empty())?;
|
||||
let doc = s.doc().ok()?;
|
||||
|
||||
@@ -542,8 +542,7 @@ fn hovered_and_selected_is_hatched_once_and_regions_share_one_pattern() {
|
||||
assert!(part.iter().all(|x| all.iter().any(|y| (x - y).abs() < 1e-6)));
|
||||
}
|
||||
|
||||
/// "If there are multiple closed regions within a vector network, you can adjust the fill for each
|
||||
/// region individually" (Edit vector layers, #1875): with regions selected in edit mode, the fill
|
||||
/// Each closed region of a vector network has its own fill (#1875): with regions selected in edit mode, the fill
|
||||
/// commands edit those regions' own fills and leave the layer's; `regions` names them outright.
|
||||
#[test]
|
||||
fn the_fill_commands_edit_the_selected_regions() {
|
||||
|
||||
@@ -262,8 +262,8 @@ pub(super) fn reparent(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
|
||||
/// The regions of a vector whose own fill stacks a fill command edits instead of the layer's: the
|
||||
/// `regions` named (with one target, a vector; indices into its network's regions), else the
|
||||
/// regions selected in vector edit mode when the one target is the layer being edited ("you can
|
||||
/// adjust the fill for each region individually", Edit vector layers, #1875). None: the layer's.
|
||||
/// regions selected in vector edit mode when the one target is the layer being edited (#1875).
|
||||
/// None: the layer's.
|
||||
pub(crate) fn fill_regions(s: &Session, cmd: &str, p: &Value, ids: &[NodeId]) -> Result<Option<(NodeId, Vec<usize>)>> {
|
||||
let doc = s.doc()?;
|
||||
let region_count = |id: NodeId| match doc.node(id).map(|n| &n.kind) {
|
||||
|
||||
@@ -293,8 +293,7 @@ pub(super) fn paints(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeI
|
||||
}
|
||||
let t = Tokens::get(ui.ctx());
|
||||
let ids = sel.to_vec();
|
||||
// Regions selected in vector edit mode: their own fills ("you can adjust the fill for each
|
||||
// region individually", Edit vector layers, #1875); the fill commands edit those too.
|
||||
// Regions selected in vector edit mode: their own fills (#1875); the fill commands edit those too.
|
||||
let region_list = match sel {
|
||||
[id] if fills => figcraft_engine::vectoredit::selected_region_fills(&app.session, *id),
|
||||
_ => None,
|
||||
|
||||
@@ -191,7 +191,6 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look
|
||||
| 2026-11-05 | minor | M4, #1830: a paragraph's base direction can be forced (`TextDirection`: Auto, Ltr, Rtl on `ParaList`): Text ▸ Text direction ▸ Auto / Left to right / Right to left (`text.directionAuto` / `Ltr` / `Rtl`) and `text.direction {direction, ids?}` set the edited paragraphs while editing, else the layer's; `node.set textDirection`; the Type settings control once a right-to-left script is in the text; inspect `textDirection` / `lineDirections`; CSS `direction`; `.fig` lines' `sourceDirectionality` in and out. Layout gives each paragraph its base level (`Bidi::of` runs the algorithm per paragraph, as it starts over at each). Before, direction came from the letters only ("controls are available to override text direction per paragraph", Add right-to-left text). Tests: `text_behaviour_tests::text_direction_is_forced_per_paragraph`, `fig::text_direction_tests::a_lines_source_directionality_is_its_paragraphs_direction_both_ways`. |
|
||||
| 2026-11-05 | patch | M1, #2003: the Design panel's boolean operation menu leads Union, Subtract, Intersect and Exclude with original icons drawn in code (two offset squares, the result filled at reduced alpha). Numbers unchanged. |
|
||||
| 2026-11-02 | minor | M8, #1875: a fill per region. With regions of a vector selected in edit mode (a press inside one with the Move tool, `vector.edit.select {regions}`), the Fill section lists the regions' own fills (the layer's for a region that has none; mixed content when they differ) and its rows and the colour picker edit them: `fill.set`, `fill.add`, `fill.remove`, `fill.move` and `fill.paste` on the edited layer go to the selected regions' stacks (`Region.fills`, what the renderer already draws), the layer's fills and fill style untouched; `regions: [index, ...]` names them on any vector layer ("If there are multiple closed regions within a vector network, you can adjust the fill for each region individually", Edit vector layers). Tests: `regions_tests::the_fill_commands_edit_the_selected_regions`. Numbers unchanged. |
|
||||
| 2026-11-02 | patch | Fill section: a text whose characters were coloured differently while editing shows mixed content, as a mixed selection does ("Text nodes can have multiple sets of fills if some characters are colored differently than others", the developer documentation's `fills`); characters that all share fills the layer doesn't have (all of them styled while editing) show those instead of the layer's older list; and a layer-level fill edit (a row, its picker, +, reordering, `fill.*`, `node.set`) reaches every character, their own fills going in the same undo step. The section used to show the layer's own fill, a single colour the canvas no longer showed (#1856). Tests: `text_mixed_fill_tests`, engine `text_fill_tests`. Numbers unchanged |
|
||||
| 2026-11-05 | patch | M1, #1758: a mouse's side buttons (4 and 5) pan the canvas as the middle button does, the pan ending on release over the canvas or off it; the grab cursor shows while they're held. |
|
||||
| 2026-11-04 | patch | M1, #1852: a press on one of the open gradient's handles or stops on the canvas is the colour picker's own, not a press outside it (Figma keeps the picker and the handles up while a handle or stop is dragged; the stops are made to be dragged: "You can click and drag a stop to change its placement on the gradient", Use gradients as a fill or stroke). The canvas took the press and began the drag, then the picker, drawn later in the same frame, saw a press outside its card and closed, committing the drag's interaction at once; the handles vanished with it and the drag went on without an undo step of its own. Now the picker stays while a gradient handle or stop drags, and the drag is one undo step; a press elsewhere on the canvas still closes it. A handle drag whose button goes up off the canvas (over a panel or the picker) ends there too, instead of waiting, uncommitted, to move the handle to the next press on the canvas. Tests: `colorpicker_selection_tests::dragging_a_gradient_handle_on_the_canvas_keeps_the_picker_open`, `colorpicker_selection_tests::a_gradient_drag_released_off_the_canvas_ends_there`. |
|
||||
| 2026-11-02 | patch | M8, #1875: a click with the Bend tool on a sharp point between two segments gives it handles along the line between its neighbours, a third of the way to each ("Click on a point or path where you want to add a curve", Edit vector layers); a click on a curved point still makes it sharp, a drag still sets the handles by hand, an endpoint is left alone. Between a handle's end and a point both within reach of the pointer, the nearer one on the page is hit (the handle on a tie), so a short path's point (its handles a few pixels long) can be clicked again. Before, only a drag curved a point, and a short one left two tiny handles in its direction. Tests: `vectoredit::tests::short_handles_leave_their_point_clickable`, `vectoredit::tests::a_bend_click_curves_a_sharp_point_between_its_neighbours`, `bend_tool_smooths_and_sharpens_points`. Numbers unchanged. |
|
||||
|
||||
Reference in new issue
Block a user