mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-31 05:07:51 -06:00
Image Trace: Shapes, and corners whose pixel is mostly outside the shape
Shapes (params `shapes`, a checkbox in the panel; off unless asked for): a filled outline that is a circle, an ellipse, a rectangle or a regular polygon comes out as that live shape. A shape is only made when every point of the traced outline lies within 0.5 px (0.2% of the shape's size, if more) of it; an ellipse whose radii differ by less than twice that is a circle of its area. The outline before fitting: a corner's own pixel no longer pulls the two edges that meet there, and a one-pixel step between two long edges is the corner where they meet. Sharp corners kept: Default 69% -> 76%, the colour presets 86% -> 91%. The harness gains plain-shape inputs and "shapes %".
This commit is contained in:
@@ -360,6 +360,12 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
st.preset = "Custom".into();
|
||||
retrace = true;
|
||||
}
|
||||
let shapes = st.params["shapes"].as_bool().unwrap_or(false);
|
||||
if widgets::check(ui, tl!("Shapes"), shapes, true) {
|
||||
st.params["shapes"] = json!(!shapes);
|
||||
st.preset = "Custom".into();
|
||||
retrace = true;
|
||||
}
|
||||
// Ignore Color: white, unless another colour is picked.
|
||||
ui.horizontal(|ui| {
|
||||
let on = st.params["ignoreWhite"].as_bool().unwrap_or(false);
|
||||
|
||||
Reference in New Issue
Block a user