Generator panel in the reference app's layout; effect blend and opacity on their rows

- The generator properties move to generator_panel.rs: Attributes
  (description, category, tags), Resolution, Parameters with the global
  adjustments first, a seed with Random and a pencil to type it, Restore
  defaults, and Image inputs (a picture of what each input reads, a
  source menu, images dropped from Assets).
- Effect rows get a blend mode menu and an opacity field at their right;
  the effect properties no longer show them. Effect rows alternate two
  shades just above the panel, so they read as rows under their layer.
- Layer and effect rows share the blend mode and opacity controls: the
  opacity reads as plain text (no field box) and one drag is one undo
  step.
- Translations for every new string in the 9 languages.
This commit is contained in:
Rebornim committed 2026-11-12 04:39:55 +00:00
1 parent 7bd6c0ef2b
commit 03660e5a21
8 files changed
+1115 -492

No files matched your search

+422 -353
View File
File diff suppressed because it is too large. Load diff
+385
View File
@@ -0,0 +1,385 @@
//! A generator effect's properties, laid out like the reference app's: attributes, resolution, parameters, image inputs.
use egui::{RichText, Ui};
use egui_phosphor::regular as ic;
use serde_json::{Value, json};
use texturecraft_engine::core::{BakedMap, CurvatureDetail, CurvatureMode, Generator, GeneratorKind, LayerId, OutputResolution, ResolutionMode, Source};
use crate::TextureCraftApp;
use crate::dock::{anchor_label, anchors_below, image_drop, image_menu, mesh_map_color};
use crate::i18n::{baked_map_label, tr, trf};
use crate::theme::{Tokens, caption};
use crate::widgets::{combo, section, slider_edit};
/// Random seeds stay below this, short enough to read and type.
const SEED_RANGE: u32 = 10_000;
/// Knuth's multiplicative hash constant: spreads the clock's nanoseconds over the seed range.
const SEED_MIX: u32 = 2_654_435_761;
/// Font size of the notes under a control.
const NOTE_FONT_SIZE: f32 = 10.5;
/// Edge of the picture beside each image input, its corner rounding and the size of an icon drawn in it.
const INPUT_TILE_SIZE: f32 = 32.0;
const INPUT_TILE_ROUNDING: f32 = 2.0;
const INPUT_TILE_ICON_SIZE: f32 = 16.0;
/// Width of the names in the Attributes section, so their values line up.
const ATTRIBUTE_KEY_WIDTH: f32 = 80.0;
/// The settings of generator effect `id`.
pub(crate) fn generator_properties(app: &mut TextureCraftApp, ui: &mut Ui, layer: LayerId, id: u64, generator: &Generator) {
let tokens = Tokens::get(ui.ctx());
ui.label(caption(tr("Generator")));
egui::ComboBox::from_id_salt("gen_kind").selected_text(tr(generator.kind.label())).show_ui(ui, |ui| {
for kind in GeneratorKind::ALL {
if ui.selectable_label(kind == generator.kind, tr(kind.label())).clicked() {
// Another kind starts from its own defaults: this effect is removed and one of that kind added
app.run("effect.remove", json!({"effect": id}));
app.run("effect.add.generator", json!({"generator": format!("{kind:?}")}));
}
}
});
section(ui, "generator_attributes", tr("Attributes"), false, |ui| attributes(ui, generator.kind));
section(ui, "generator_resolution", tr("Resolution"), false, |ui| resolution(app, ui, id, generator.resolution));
section(ui, "generator_parameters", tr("Parameters"), true, |ui| {
global_adjustments(app, ui, id, generator);
ramp_parameters(app, ui, id, generator);
if matches!(generator.kind, GeneratorKind::Curvature | GeneratorKind::EdgeWear) {
curvature_detail_properties(app, ui, id, generator.detail.as_ref());
}
ui.horizontal(|ui| {
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
if ui.button(tr("Restore defaults")).clicked() {
app.run("effect.set", defaults_of(id, generator.kind));
}
});
});
});
if !generator.kind.inputs().is_empty() {
section(ui, "generator_inputs", tr("Image inputs"), true, |ui| {
for map in generator.kind.inputs() {
input_slot(app, ui, (layer, id), *map, generator.inputs.get(map), generator.detail.is_some());
}
});
}
if !app.session.doc.baked.contains_key(&app.session.ts()) {
ui.label(
RichText::new(format!("{} {}", ic::WARNING, tr("Bake mesh maps (F8) for curvature, AO and thickness based generators."))).color(tokens.warning),
);
}
}
/// What a generator kind makes, its category and its tags (read only).
fn attributes(ui: &mut Ui, kind: GeneratorKind) {
let tokens = Tokens::get(ui.ctx());
let (description, tags) = match kind {
GeneratorKind::EdgeWear => (
tr("Convex edges from the curvature map, broken up by noise: worn paint and polished edges."),
[tr("mask"), tr("generator"), tr("grayscale"), tr("curvature")],
),
GeneratorKind::Dirt => (
tr("Crevices and occluded areas from the ambient occlusion map: dirt and grime."),
[tr("mask"), tr("generator"), tr("grayscale"), tr("ambient occlusion")],
),
GeneratorKind::ThinAreas => (tr("Thin parts of the mesh from the thickness map."), [tr("mask"), tr("generator"), tr("grayscale"), tr("thickness")]),
GeneratorKind::Curvature => (
tr("Convex edges, cavities or both from the curvature map, at several detail sizes."),
[tr("mask"), tr("generator"), tr("grayscale"), tr("curvature")],
),
GeneratorKind::AmbientOcclusion => {
(tr("Occluded areas from the ambient occlusion map."), [tr("mask"), tr("generator"), tr("grayscale"), tr("ambient occlusion")])
}
GeneratorKind::Position => (tr("A gradient along a world direction across the mesh."), [tr("mask"), tr("generator"), tr("grayscale"), tr("position")]),
GeneratorKind::Direction => (tr("Surfaces facing a direction, as if lit from it."), [tr("mask"), tr("generator"), tr("grayscale"), tr("normal")]),
};
// Wrapped rows: a long line must not widen the panel past its edge
let tags = tags.join(", ");
for (key, value) in [(tr("Description"), description), (tr("Category"), tr("Generators")), (tr("Tags"), tags.as_str())] {
ui.horizontal_top(|ui| {
ui.add_sized([ATTRIBUTE_KEY_WIDTH, 0.0], egui::Label::new(RichText::new(key).color(tokens.text_dim)));
ui.add(egui::Label::new(value).wrap());
});
}
}
/// What the generator's output resolution is based on, the factor applied to it, and the size it comes to.
fn resolution(app: &mut TextureCraftApp, ui: &mut Ui, id: u64, resolution: OutputResolution) {
let tokens = Tokens::get(ui.ctx());
combo(ui, tr("Resolution"), tr(resolution.mode.label()), |ui| {
for mode in ResolutionMode::ALL {
if ui.selectable_label(mode == resolution.mode, tr(mode.label())).clicked() {
app.run("effect.set", json!({"effect": id, "resolution": format!("{mode:?}")}));
}
}
})
.on_hover_text(tr("Auto and UV tile use the UV tile's resolution, Texture set the texture set's, Custom a size of its own."));
if resolution.mode == ResolutionMode::Custom {
combo(ui, tr("Size"), format!("{0} × {0}", resolution.custom), |ui| {
for size in OutputResolution::CUSTOM_SIZES {
if ui.selectable_label(size == resolution.custom, format!("{size} × {size}")).clicked() {
app.run("effect.set", json!({"effect": id, "customResolution": size}));
}
}
});
}
combo(ui, tr("Factor"), factor_label(resolution.factor), |ui| {
for factor in OutputResolution::FACTORS {
if ui.selectable_label(factor == resolution.factor, factor_label(factor)).clicked() {
app.run("effect.set", json!({"effect": id, "resolutionFactor": factor}));
}
}
})
.on_hover_text(tr("Scales the base resolution: below 1 the generator is computed coarser and smoothed back up."));
let Ok(texture_set) = app.session.doc.project.texture_set(app.session.ts()).map(|set| set.resolution) else { return };
let size = resolution.output_size(texture_set, texture_set);
ui.horizontal(|ui| {
ui.label(RichText::new(tr("Output size")).color(tokens.text_dim));
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| ui.label(format!("{size} × {size}")));
})
.response
.on_hover_text(tr("A finer output than the texture set gives the same result as the texture set's resolution."));
}
/// The most powers of two a resolution factor scales by, either way.
const LARGEST_FACTOR_STEPS: u8 = OutputResolution::FACTORS.end().unsigned_abs();
/// "Same as context", or the fraction or multiple a resolution factor stands for.
fn factor_label(factor: i8) -> String {
match factor {
0 => tr("Same as context").to_string(),
negative if negative < 0 => format!("1/{}", 1u32 << negative.unsigned_abs().min(LARGEST_FACTOR_STEPS)),
positive => format!("×{}", 1u32 << positive.unsigned_abs().min(LARGEST_FACTOR_STEPS)),
}
}
/// Global invert, blur, balance and contrast: what every generator applies to its finished value.
fn global_adjustments(app: &mut TextureCraftApp, ui: &mut Ui, id: u64, generator: &Generator) {
let (mut invert, mut global) = (generator.invert, generator.global);
let invert_edit = ui.checkbox(&mut invert, tr("Global invert")).changed().then_some(false);
let blur_edit = slider_edit(ui, tr("Global blur"), &mut global.blur, 0.0..=1.0, 2);
let balance_edit = slider_edit(ui, tr("Global balance"), &mut global.balance, 0.0..=1.0, 2);
let contrast_edit = slider_edit(ui, tr("Global contrast"), &mut global.contrast, 0.0..=1.0, 2);
if let Some(merge) = invert_edit.or(blur_edit).or(balance_edit).or(contrast_edit) {
app.run(
"effect.set",
json!({"effect": id, "invert": invert, "blur": global.blur, "balance": global.balance, "contrast": global.contrast, "merge": merge}),
);
}
}
/// Where the generator's ramp starts, how soft it is, the noise breaking it up, its offset and its seed.
fn ramp_parameters(app: &mut TextureCraftApp, ui: &mut Ui, id: u64, generator: &Generator) {
let (mut level, mut softness, mut noise, mut noise_scale, mut offset) =
(generator.level, generator.softness, generator.noise_amount, generator.noise_scale, generator.offset);
let level_edit = slider_edit(ui, tr("Level"), &mut level, 0.0..=1.0, 2);
let softness_edit = slider_edit(ui, tr("Softness"), &mut softness, 0.0..=1.0, 2);
let noise_edit = slider_edit(ui, tr("Noise amount"), &mut noise, 0.0..=2.0, 2);
let noise_scale_edit = slider_edit(ui, tr("Noise scale"), &mut noise_scale, 0.1..=64.0, 1);
let offset_edit = slider_edit(ui, tr("Offset"), &mut offset, -1.0..=1.0, 2);
if let Some(merge) = level_edit.or(softness_edit).or(noise_edit).or(noise_scale_edit).or(offset_edit) {
app.run(
"effect.set",
json!({"effect": id, "level": level, "softness": softness, "noise": noise, "noiseScale": noise_scale, "offset": offset, "merge": merge}),
);
}
seed_row(app, ui, id, generator.seed);
}
/// The seed with a button that picks a new one and a pencil that opens a field to type it, as in the reference.
fn seed_row(app: &mut TextureCraftApp, ui: &mut Ui, id: u64, seed: u32) {
let typing_id = ui.make_persistent_id(("generator_seed_typing", id));
let mut typing = ui.data(|data| data.get_temp::<bool>(typing_id)).unwrap_or(false);
ui.horizontal(|ui| {
ui.label(tr("Seed"));
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
if ui.selectable_label(typing, ic::PENCIL_SIMPLE).on_hover_text(tr("Type the seed")).clicked() {
typing = !typing;
}
if typing {
let mut typed = seed;
let field = ui.add(egui::DragValue::new(&mut typed).speed(1.0));
if field.changed() {
// The later changes of one drag continue its first undo step
let merge = field.dragged() && !field.drag_started();
app.run("effect.set", json!({"effect": id, "seed": typed, "merge": merge}));
}
} else if ui.button(tr("Random")).on_hover_text(trf("Seed {seed}", &[("seed", &seed)])).clicked() {
app.run("effect.set", json!({"effect": id, "seed": random_seed(seed)}));
}
});
});
ui.data_mut(|data| data.insert_temp(typing_id, typing));
}
/// A seed different from `current`, from the clock.
fn random_seed(current: u32) -> u32 {
let nanos = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).map_or(0, |elapsed| elapsed.subsec_nanos());
let mixed = nanos.wrapping_mul(SEED_MIX) % SEED_RANGE;
if mixed == current { (mixed + 1) % SEED_RANGE } else { mixed }
}
/// The `effect.set` params that put generator effect `id` back to the defaults of its kind.
fn defaults_of(id: u64, kind: GeneratorKind) -> Value {
let defaults = Generator::new(kind);
let mut params = json!({
"effect": id,
"level": defaults.level,
"softness": defaults.softness,
"noise": defaults.noise_amount,
"noiseScale": defaults.noise_scale,
"offset": defaults.offset,
"seed": defaults.seed,
"direction": defaults.direction,
"invert": defaults.invert,
"blur": defaults.global.blur,
"balance": defaults.global.balance,
"contrast": defaults.global.contrast,
"resolution": format!("{:?}", defaults.resolution.mode),
"customResolution": defaults.resolution.custom,
"resolutionFactor": defaults.resolution.factor,
});
if let Some(detail) = defaults.detail {
params["mode"] = json!(format!("{:?}", detail.mode));
params["sizes"] = json!(detail.weights);
}
params
}
/// The curvature mode and detail size weights of generator effect `id` (`detail` None: saved before detail sizes).
fn curvature_detail_properties(app: &mut TextureCraftApp, ui: &mut Ui, id: u64, detail: Option<&CurvatureDetail>) {
let tokens = Tokens::get(ui.ctx());
let shown = detail.cloned().unwrap_or_default();
combo(ui, tr("Mode"), curvature_mode_label(shown.mode), |ui| {
for mode in CurvatureMode::ALL {
if ui.selectable_label(mode == shown.mode, curvature_mode_label(mode)).clicked() {
app.run("effect.set", json!({"effect": id, "mode": format!("{mode:?}")}));
}
}
});
ui.label(caption(tr("Detail sizes")));
let mut weights = shown.weights;
let mut edit = None;
for (weight, size) in weights.iter_mut().zip(CurvatureDetail::SIZES) {
edit = edit.or(slider_edit(ui, &format!("{size} px"), weight, 0.0..=1.0, 2));
}
if let Some(merge) = edit {
app.run("effect.set", json!({"effect": id, "sizes": weights, "merge": merge}));
}
if detail.is_none() {
ui.label(RichText::new(tr("Reads the curvature map as baked: changing the mode or a size turns detail sizes on.")).color(tokens.text_dim));
}
}
/// The translated name of curvature mode `mode`.
fn curvature_mode_label(mode: CurvatureMode) -> &'static str {
match mode {
CurvatureMode::Edges => tr("Edges"),
CurvatureMode::Cavities => tr("Cavities"),
CurvatureMode::Both => tr("Edges and cavities"),
CurvatureMode::Raw => tr("Raw curvature"),
}
}
/// One input of generator effect `id` on `layer`: what it reads (its mesh map unless `source` replaces it), a menu to replace it, and a button to read the mesh map again.
fn input_slot(app: &mut TextureCraftApp, ui: &mut Ui, (layer, id): (LayerId, u64), map: BakedMap, source: Option<&Source>, detail_sizes: bool) {
let tokens = Tokens::get(ui.ctx());
let input = map.id();
let current = match source {
None => trf("Mesh map: {map}", &[("map", &tr(baked_map_label(map)))]),
Some(Source::Image { name, .. }) => trf("Image: {name}", &[("name", name)]),
Some(Source::Uniform(_)) => tr("Uniform value").to_string(),
Some(Source::Anchor { anchor, channel }) => anchor_label(app, *anchor, *channel),
Some(Source::Procedural { .. }) => tr("Procedural").to_string(),
};
let group = ui.group(|ui| {
ui.horizontal(|ui| {
input_tile(app, ui, map, source);
ui.vertical(|ui| {
ui.label(RichText::new(tr(baked_map_label(map))).strong());
ui.label(RichText::new(&current).size(NOTE_FONT_SIZE).color(tokens.text_dim));
});
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
if source.is_some() && ui.button(ic::X).on_hover_text(tr("Read the mesh map again")).clicked() {
app.run("effect.set", json!({"effect": id, "input": input, "inputBaked": true}));
}
});
});
combo(ui, tr("Source"), current.clone(), |ui| {
let anchors = anchors_below(app, layer);
if ui.selectable_label(source.is_none(), tr("Mesh map")).clicked() {
app.run("effect.set", json!({"effect": id, "input": input, "inputBaked": true}));
}
if ui.selectable_label(matches!(source, Some(Source::Uniform(_))), tr("Uniform value")).clicked() {
app.run("effect.set", json!({"effect": id, "input": input, "inputValue": map.neutral()[0]}));
}
for (anchor, label) in &anchors {
if ui
.selectable_label(
matches!(source, Some(Source::Anchor { anchor: picked, .. }) if picked == anchor),
trf("Anchor: {name}", &[("name", label)]),
)
.clicked()
{
app.run("effect.set", json!({"effect": id, "input": input, "inputAnchor": anchor.0}));
}
}
if let Some(name) = image_menu(app, ui) {
app.run("effect.set", json!({"effect": id, "input": input, "inputImage": name}));
}
});
if let Some(Source::Uniform(value)) = source {
let mut value = value[0];
if let Some(merge) = slider_edit(ui, tr("Value"), &mut value, 0.0..=1.0, 2) {
app.run("effect.set", json!({"effect": id, "input": input, "inputValue": value, "merge": merge}));
}
}
if detail_sizes && map == BakedMap::Curvature && source.is_some_and(|source| !matches!(source, Source::Uniform(_))) {
ui.label(
RichText::new(tr("Detail sizes blur the mesh map, so a replaced curvature input is read at its own size only."))
.size(NOTE_FONT_SIZE)
.color(tokens.text_dim),
);
}
});
if let Some(name) = image_drop(ui, &group.response) {
app.run("effect.set", json!({"effect": id, "input": input, "inputImage": name}));
}
}
/// The picture of what an input reads: the image itself, the uniform value's gray, or the mesh map's swatch (as in the texture set's list).
fn input_tile(app: &mut TextureCraftApp, ui: &mut Ui, map: BakedMap, source: Option<&Source>) {
let tokens = Tokens::get(ui.ctx());
let (rect, _) = ui.allocate_exact_size(egui::vec2(INPUT_TILE_SIZE, INPUT_TILE_SIZE), egui::Sense::hover());
let painter = ui.painter();
let whole = egui::Rect::from_min_max(egui::pos2(0.0, 0.0), egui::pos2(1.0, 1.0));
match source {
Some(Source::Image { name, .. }) => match app.session.images.get(name) {
Some(image) => {
let texture = app.thumbs.image(ui.ctx(), name, image);
painter.image(texture.id(), rect, whole, egui::Color32::WHITE);
}
None => {
painter.rect_filled(rect, INPUT_TILE_ROUNDING, tokens.button);
}
},
Some(Source::Uniform(value)) => {
painter.rect_filled(rect, INPUT_TILE_ROUNDING, egui::Color32::from_gray((value[0].clamp(0.0, 1.0) * 255.0).round() as u8));
}
Some(Source::Anchor { .. } | Source::Procedural { .. }) => {
let glyph = if matches!(source, Some(Source::Anchor { .. })) { ic::ANCHOR } else { ic::MAGIC_WAND };
painter.rect_filled(rect, INPUT_TILE_ROUNDING, tokens.button);
painter.text(rect.center(), egui::Align2::CENTER_CENTER, glyph, egui::FontId::proportional(INPUT_TILE_ICON_SIZE), tokens.text_dim);
}
None => {
let baked = app.session.doc.baked.get(&app.session.ts()).is_some_and(|baked| baked.maps.contains_key(&map));
painter.rect_filled(rect, INPUT_TILE_ROUNDING, if baked { mesh_map_color(map) } else { tokens.button });
}
}
painter.rect_stroke(rect, INPUT_TILE_ROUNDING, egui::Stroke::new(1.0, tokens.button_border), egui::StrokeKind::Outside);
}
+1
View File
@@ -20,6 +20,7 @@ pub mod export_templates;
pub mod file_dialogs;
mod filter_slot;
pub mod fonts;
mod generator_panel;
pub mod gpu;
pub mod i18n;
pub mod id_color_pick;
+58 -21
View File
@@ -1,4 +1,4 @@
//! Effect rows in the layer stack: dragging one reorders its stack.
//! Effect rows in the layer stack: dragging one reorders its stack, and its blend mode and opacity sit at its right.
use egui_kittest::Harness;
use egui_kittest::kittest::Queryable;
@@ -12,16 +12,16 @@ fn id(v: Value, key: &str) -> u64 {
}
/// Drag the row labelled `from` onto the upper (`below` false) or lower half of the row `to`.
fn drag(h: &mut Harness<'_, TextureCraftApp>, from: &str, to: &str, below: bool) {
let start = h.get_by_label(from).rect().center();
let r = h.get_by_label(to).rect();
let end = egui::pos2(r.center().x, if below { r.bottom() - 4.0 } else { r.top() + 4.0 });
h.drag_at(start);
h.run_steps(2);
h.hover_at(end);
h.run_steps(2);
h.drop_at(end);
h.run_steps(3);
fn drag(harness: &mut Harness<'_, TextureCraftApp>, from: &str, to: &str, below: bool) {
let start = harness.get_by_label(from).rect().center();
let row_rect = harness.get_by_label(to).rect();
let end = egui::pos2(row_rect.center().x, if below { row_rect.bottom() - 4.0 } else { row_rect.top() + 4.0 });
harness.drag_at(start);
harness.run_steps(2);
harness.hover_at(end);
harness.run_steps(2);
harness.drop_at(end);
harness.run_steps(3);
}
#[test]
@@ -32,17 +32,54 @@ fn dragging_an_effect_row_reorders_its_stack() {
|name: &str| id(execute(&mut session, "effect.add.filter", &json!({"target": "content", "filter": "invert", "name": name})).unwrap(), "effect");
let (a, b, c) = (add("Effect A"), add("Effect B"), add("Effect C"));
execute(&mut session, "layer.select", &json!({"layer": layer.0})).unwrap();
let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).build_eframe(|cc| TextureCraftApp::new(cc, session));
h.run_steps(4);
let order = |h: &Harness<'_, TextureCraftApp>| h.state().session.doc.project.layers[&layer].content_effects.iter().map(|e| e.id.0).collect::<Vec<_>>();
assert_eq!(order(&h), [a, b, c]);
let mut harness = Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).build_eframe(|creation_context| TextureCraftApp::new(creation_context, session));
harness.run_steps(4);
let order =
|harness: &Harness<'_, TextureCraftApp>| harness.state().session.doc.project.layers[&layer].content_effects.iter().map(|e| e.id.0).collect::<Vec<_>>();
assert_eq!(order(&harness), [a, b, c]);
// The rows list the top first: C, B, A. A dropped on C's upper half goes to the top.
drag(&mut h, "Effect A", "Effect C", false);
assert_eq!(order(&h), [b, c, a]);
drag(&mut harness, "Effect A", "Effect C", false);
assert_eq!(order(&harness), [b, c, a]);
// A dropped on B's lower half goes back to the bottom.
drag(&mut h, "Effect A", "Effect B", true);
assert_eq!(order(&h), [a, b, c]);
drag(&mut harness, "Effect A", "Effect B", true);
assert_eq!(order(&harness), [a, b, c]);
// C dropped on A's upper half lands between A and B.
drag(&mut h, "Effect C", "Effect A", false);
assert_eq!(order(&h), [a, c, b]);
drag(&mut harness, "Effect C", "Effect A", false);
assert_eq!(order(&harness), [a, c, b]);
}
/// An effect row's blend mode menu and opacity field sit at its right, as on layer rows.
#[test]
fn an_effect_row_sets_its_blend_mode_and_opacity() {
let mut session = texturecraft_engine::sample_session(256, 64).unwrap();
let layer = LayerId(id(execute(&mut session, "layer.add.fill", &Value::Null).unwrap(), "layer"));
let effect = id(execute(&mut session, "effect.add.filter", &json!({"target": "content", "filter": "invert", "name": "Effect A"})).unwrap(), "effect");
execute(&mut session, "layer.select", &json!({"layer": layer.0})).unwrap();
let mut harness = Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).build_eframe(|creation_context| TextureCraftApp::new(creation_context, session));
harness.run_steps(4);
let effect_of = |harness: &Harness<'_, TextureCraftApp>| harness.state().session.doc.project.layers[&layer].content_effects[0].clone();
assert_eq!(effect, effect_of(&harness).id.0);
// From the row's right edge: a 4-point gap, then the 82-point pair of mode menu and opacity field
let row = harness.get_by_label("Effect A").rect();
let pair_right = row.right() - 4.0;
let pair_left = pair_right - 82.0;
let mode_at = egui::pos2(pair_left + 20.0, row.center().y);
harness.drag_at(mode_at);
harness.drop_at(mode_at);
harness.run_steps(2);
harness.get_by_label("Multiply").click();
harness.run_steps(3);
assert_eq!(effect_of(&harness).blend, texturecraft_engine::core::BlendMode::Multiply);
let history = harness.state().session.history_labels().len();
let opacity_at = egui::pos2(pair_right - 20.0, row.center().y);
harness.drag_at(opacity_at);
harness.run_steps(2);
harness.hover_at(opacity_at - egui::vec2(100.0, 0.0));
harness.run_steps(2);
harness.drop_at(opacity_at - egui::vec2(100.0, 0.0));
harness.run_steps(3);
assert!(effect_of(&harness).opacity < 0.9, "dragging the field to the left lowers the opacity: {}", effect_of(&harness).opacity);
assert_eq!(harness.state().session.history_labels().len(), history + 1, "the whole drag is one undo step");
}
+117 -115
View File
@@ -1,5 +1,4 @@
//! The sliders of a selected effect (opacity, generator, levels…) apply what they were dragged
//! or clicked to.
//! A selected effect's sliders apply what they are dragged, clicked or typed to (a generator's global balance stands in for them all).
use egui::accesskit::Role;
use egui_kittest::Harness;
@@ -9,79 +8,82 @@ use texturecraft_engine::core::{EffectKind, LayerId};
use texturecraft_ui_egui::TextureCraftApp;
/// The sample session with its first generator effect selected, and that effect's id.
fn harness() -> (Harness<'static, TextureCraftApp>, LayerId) {
fn selected_generator() -> (Harness<'static, TextureCraftApp>, LayerId) {
let mut session = texturecraft_engine::sample_session(256, 64).unwrap();
let (layer, effect) = session
.doc
.project
.layers
.values()
.find_map(|l| {
let mask = l.mask.iter().flat_map(|m| m.effects.iter());
l.content_effects.iter().chain(mask).find(|e| matches!(e.kind, EffectKind::Generator(_))).map(|e| (l.id, e.id))
.find_map(|label_rect| {
let mask = label_rect.mask.iter().flat_map(|m| m.effects.iter());
label_rect.content_effects.iter().chain(mask).find(|e| matches!(e.kind, EffectKind::Generator(_))).map(|e| (label_rect.id, e.id))
})
.unwrap();
texturecraft_engine::execute(&mut session, "layer.select", &json!({"layer": layer.0, "target": effect.0})).unwrap();
let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).build_eframe(|cc| TextureCraftApp::new(cc, session));
h.run_steps(4);
(h, effect)
let mut harness = Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).build_eframe(|creation_context| TextureCraftApp::new(creation_context, session));
harness.run_steps(4);
(harness, effect)
}
fn opacity(h: &Harness<'_, TextureCraftApp>, effect: LayerId) -> f32 {
h.state().session.doc.project.effect(effect).unwrap().1.opacity
fn balance(harness: &Harness<'_, TextureCraftApp>, effect: LayerId) -> f32 {
match &harness.state().session.doc.project.effect(effect).unwrap().1.kind {
EffectKind::Generator(generator) => generator.global.balance,
_ => panic!("a generator"),
}
}
/// The track under the slider labelled `label` (the row below the label).
fn track(h: &Harness<'_, TextureCraftApp>, label: &str) -> egui::Rect {
let l = h.get_by_label(label).rect();
egui::Rect::from_min_max(egui::pos2(l.left() + 6.0, l.bottom() + 6.0), egui::pos2(l.left() + 200.0, l.bottom() + 14.0))
fn track(harness: &Harness<'_, TextureCraftApp>, label: &str) -> egui::Rect {
let label_rect = harness.get_by_label(label).rect();
egui::Rect::from_min_max(egui::pos2(label_rect.left() + 6.0, label_rect.bottom() + 6.0), egui::pos2(label_rect.left() + 200.0, label_rect.bottom() + 14.0))
}
#[test]
fn dragging_the_effect_opacity_applies_it() {
let (mut h, effect) = harness();
assert_eq!(opacity(&h, effect), 1.0);
let t = track(&h, "Opacity");
h.drag_at(egui::pos2(t.right(), t.center().y));
h.run_steps(2);
h.hover_at(egui::pos2(t.left() + 20.0, t.center().y));
h.run_steps(2);
h.drop_at(egui::pos2(t.left() + 20.0, t.center().y));
h.run_steps(3);
assert!(opacity(&h, effect) < 0.5, "the dragged opacity applies: {}", opacity(&h, effect));
fn dragging_a_slider_applies_it() {
let (mut harness, effect) = selected_generator();
assert_eq!(balance(&harness, effect), 0.5);
let track_rect = track(&harness, "Global balance");
harness.drag_at(egui::pos2(track_rect.right(), track_rect.center().y));
harness.run_steps(2);
harness.hover_at(egui::pos2(track_rect.left() + 20.0, track_rect.center().y));
harness.run_steps(2);
harness.drop_at(egui::pos2(track_rect.left() + 20.0, track_rect.center().y));
harness.run_steps(3);
assert!(balance(&harness, effect) < 0.25, "the dragged balance applies: {}", balance(&harness, effect));
}
/// A generator slider applies while it is dragged (the texture follows the pointer), and the
/// whole drag is one undo step.
#[test]
fn dragging_a_generator_slider_applies_live_as_one_undo_step() {
let (mut h, effect) = harness();
let level = |h: &Harness<'_, TextureCraftApp>| match &h.state().session.doc.project.effect(effect).unwrap().1.kind {
let (mut harness, effect) = selected_generator();
let level = |harness: &Harness<'_, TextureCraftApp>| match &harness.state().session.doc.project.effect(effect).unwrap().1.kind {
EffectKind::Generator(g) => g.level,
_ => panic!("a generator"),
};
let steps = h.state().session.history_labels().len();
let t = track(&h, "Level");
let at = |x: f32| egui::pos2(t.left() + x, t.center().y);
h.drag_at(at(10.0));
h.run_steps(2);
let steps = harness.state().session.history_labels().len();
let track_rect = track(&harness, "Level");
let at = |x: f32| egui::pos2(track_rect.left() + x, track_rect.center().y);
harness.drag_at(at(10.0));
harness.run_steps(2);
let mut last = 0.0;
for x in [60.0, 160.0] {
h.hover_at(at(x));
h.run_steps(2);
assert!(level(&h) > last && level(&h) != 0.5, "the level follows the drag before it is released: {last} -> {}", level(&h));
last = level(&h);
harness.hover_at(at(x));
harness.run_steps(2);
assert!(level(&harness) > last && level(&harness) != 0.5, "the level follows the drag before it is released: {last} -> {}", level(&harness));
last = level(&harness);
}
h.drop_at(at(160.0));
h.run_steps(3);
assert_eq!(level(&h), last);
assert_eq!(h.state().session.history_labels().len(), steps + 1, "one undo step for the drag");
harness.drop_at(at(160.0));
harness.run_steps(3);
assert_eq!(level(&harness), last);
assert_eq!(harness.state().session.history_labels().len(), steps + 1, "one undo step for the drag");
}
/// The combo box in the row of the levels editor's Reset button.
fn channel_picker<'a>(h: &'a Harness<'_, TextureCraftApp>) -> egui_kittest::Node<'a> {
let row = h.get_by_label("Reset").rect().center().y;
h.get_all(by().role(Role::ComboBox)).find(|node| (node.rect().center().y - row).abs() < 4.0).unwrap()
fn channel_picker<'a>(harness: &'a Harness<'_, TextureCraftApp>) -> egui_kittest::Node<'a> {
let row = harness.get_by_label("Reset").rect().center().y;
harness.get_all(by().role(Role::ComboBox)).find(|node| (node.rect().center().y - row).abs() < 4.0).unwrap()
}
/// A content levels effect offers a channel for its histogram; picking one keeps it selected.
@@ -90,102 +92,102 @@ fn content_levels_pick_the_histogram_channel() {
let mut session = texturecraft_engine::sample_session(256, 64).unwrap();
texturecraft_engine::execute(&mut session, "layer.add.fill", &json!({"color": [0.5, 0.2, 0.1], "roughness": 0.6})).unwrap();
texturecraft_engine::execute(&mut session, "effect.add.levels", &json!({"target": "content"})).unwrap();
let mut h = Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).build_eframe(|cc| TextureCraftApp::new(cc, session));
h.run_steps(4);
assert_eq!(channel_picker(&h).value().as_deref(), Some("Base color"), "the layer's first channel");
channel_picker(&h).click();
h.run_steps(2);
h.get_by_label("Roughness").click();
h.run_steps(3);
assert_eq!(channel_picker(&h).value().as_deref(), Some("Roughness"), "the picked channel stays");
let mut harness = Harness::builder().with_size(egui::vec2(1600.0, 1400.0)).build_eframe(|creation_context| TextureCraftApp::new(creation_context, session));
harness.run_steps(4);
assert_eq!(channel_picker(&harness).value().as_deref(), Some("Base color"), "the layer's first channel");
channel_picker(&harness).click();
harness.run_steps(2);
harness.get_by_label("Roughness").click();
harness.run_steps(3);
assert_eq!(channel_picker(&harness).value().as_deref(), Some("Roughness"), "the picked channel stays");
}
#[test]
fn clicking_the_effect_opacity_applies_it() {
let (mut h, effect) = harness();
let t = track(&h, "Opacity");
let at = egui::pos2(t.left() + 20.0, t.center().y);
h.drag_at(at);
h.drop_at(at);
h.run_steps(3);
assert!(opacity(&h, effect) < 0.5, "a click on the track applies: {}", opacity(&h, effect));
fn clicking_a_slider_track_applies_it() {
let (mut harness, effect) = selected_generator();
let track_rect = track(&harness, "Global balance");
let at = egui::pos2(track_rect.left() + 20.0, track_rect.center().y);
harness.drag_at(at);
harness.drop_at(at);
harness.run_steps(3);
assert!(balance(&harness, effect) < 0.25, "a click on the track applies: {}", balance(&harness, effect));
}
/// The number field in the row of the slider labelled `label`.
fn number_field<'a>(h: &'a Harness<'_, TextureCraftApp>, label: &str) -> egui_kittest::Node<'a> {
let row = h.get_by_label(label).rect().center().y;
h.get_all(by().role(Role::TextInput)).find(|n| (n.rect().center().y - row).abs() < 4.0).unwrap()
fn number_field<'a>(harness: &'a Harness<'_, TextureCraftApp>, label: &str) -> egui_kittest::Node<'a> {
let row = harness.get_by_label(label).rect().center().y;
harness.get_all(by().role(Role::TextInput)).find(|n| (n.rect().center().y - row).abs() < 4.0).unwrap()
}
/// Focus the opacity field and press `keys`, then type `text`, one key per frame like a person.
fn type_opacity(h: &mut Harness<'_, TextureCraftApp>, keys: &[egui::Key], text: &str) {
number_field(h, "Opacity").focus();
h.run_steps(2);
for k in keys {
h.key_press(*k);
h.run_steps(1);
/// Focus the balance field and press `keys`, then type `text`, one key per frame like a person.
fn type_balance(harness: &mut Harness<'_, TextureCraftApp>, keys: &[egui::Key], text: &str) {
number_field(harness, "Global balance").focus();
harness.run_steps(2);
for key in keys {
harness.key_press(*key);
harness.run_steps(1);
}
for c in text.chars() {
number_field(h, "Opacity").type_text(&c.to_string());
h.run_steps(1);
for character in text.chars() {
number_field(harness, "Global balance").type_text(&character.to_string());
harness.run_steps(1);
}
}
#[test]
fn a_value_typed_in_the_number_field_applies() {
let (mut h, effect) = harness();
let steps = h.state().session.history_labels().len();
type_opacity(&mut h, &[egui::Key::End, egui::Key::Backspace, egui::Key::Backspace, egui::Key::Backspace, egui::Key::Backspace], "0.25");
h.key_press(egui::Key::Enter);
h.run_steps(3);
assert_eq!(opacity(&h, effect), 0.25);
assert_eq!(h.state().session.history_labels().len(), steps + 1);
let (mut harness, effect) = selected_generator();
let steps = harness.state().session.history_labels().len();
type_balance(&mut harness, &[egui::Key::End, egui::Key::Backspace, egui::Key::Backspace, egui::Key::Backspace, egui::Key::Backspace], "0.25");
harness.key_press(egui::Key::Enter);
harness.run_steps(3);
assert_eq!(balance(&harness, effect), 0.25);
assert_eq!(harness.state().session.history_labels().len(), steps + 1);
}
/// Dragging the track while the number field has focus drops what was typed there: leaving the
/// field afterwards does not undo the drag.
#[test]
fn a_track_drag_drops_text_typed_in_the_number_field() {
let (mut h, effect) = harness();
type_opacity(&mut h, &[egui::Key::End, egui::Key::Backspace], "5");
let t = track(&h, "Opacity");
h.drag_at(egui::pos2(t.right(), t.center().y));
h.run_steps(2);
h.hover_at(egui::pos2(t.left() + 20.0, t.center().y));
h.run_steps(2);
h.drop_at(egui::pos2(t.left() + 20.0, t.center().y));
h.run_steps(2);
let dragged = opacity(&h, effect);
assert!(dragged < 0.5, "the drag applies: {dragged}");
// Leave whatever has focus: a click on empty space.
h.drag_at(egui::pos2(5.0, 1390.0));
h.drop_at(egui::pos2(5.0, 1390.0));
h.key_press(egui::Key::Enter);
h.run_steps(3);
assert_eq!(opacity(&h, effect), dragged, "the text typed before the drag stays dropped");
let (mut harness, effect) = selected_generator();
type_balance(&mut harness, &[egui::Key::End, egui::Key::Backspace], "5");
let track_rect = track(&harness, "Global balance");
harness.drag_at(egui::pos2(track_rect.right(), track_rect.center().y));
harness.run_steps(2);
harness.hover_at(egui::pos2(track_rect.left() + 20.0, track_rect.center().y));
harness.run_steps(2);
harness.drop_at(egui::pos2(track_rect.left() + 20.0, track_rect.center().y));
harness.run_steps(2);
let dragged = balance(&harness, effect);
assert!(dragged < 0.25, "the drag applies: {dragged}");
// Leave whatever has focus: a click on empty space
harness.drag_at(egui::pos2(5.0, 1390.0));
harness.drop_at(egui::pos2(5.0, 1390.0));
harness.key_press(egui::Key::Enter);
harness.run_steps(3);
assert_eq!(balance(&harness, effect), dragged, "the text typed before the drag stays dropped");
}
/// Leaving the number field without typing, or with Escape, keeps the value (not the rounded
/// text the field shows) and makes no undo step.
#[test]
fn leaving_the_number_field_unchanged_keeps_the_value() {
let (mut h, effect) = harness();
texturecraft_engine::execute(&mut h.state_mut().session, "effect.set", &json!({"effect": effect.0, "opacity": 0.333})).unwrap();
h.run_steps(2);
let steps = h.state().session.history_labels().len();
type_opacity(&mut h, &[], "");
h.key_press(egui::Key::Enter);
h.run_steps(3);
assert_eq!(opacity(&h, effect), 0.333, "left without typing");
type_opacity(&mut h, &[egui::Key::End, egui::Key::Backspace], "9");
assert_eq!(number_field(&h, "Opacity").value().as_deref(), Some("0.39"));
assert!(number_field(&h, "Opacity").is_focused());
h.key_press(egui::Key::Escape);
h.run_steps(3);
assert_eq!(opacity(&h, effect), 0.333);
// Typing the value it already has is no edit either.
type_opacity(&mut h, &[egui::Key::End, egui::Key::Backspace, egui::Key::Backspace, egui::Key::Backspace, egui::Key::Backspace], "0.333");
h.key_press(egui::Key::Enter);
h.run_steps(3);
assert_eq!(h.state().session.history_labels().len(), steps);
let (mut harness, effect) = selected_generator();
texturecraft_engine::execute(&mut harness.state_mut().session, "effect.set", &json!({"effect": effect.0, "balance": 0.333})).unwrap();
harness.run_steps(2);
let steps = harness.state().session.history_labels().len();
type_balance(&mut harness, &[], "");
harness.key_press(egui::Key::Enter);
harness.run_steps(3);
assert_eq!(balance(&harness, effect), 0.333, "left without typing");
type_balance(&mut harness, &[egui::Key::End, egui::Key::Backspace], "9");
assert_eq!(number_field(&harness, "Global balance").value().as_deref(), Some("0.39"));
assert!(number_field(&harness, "Global balance").is_focused());
harness.key_press(egui::Key::Escape);
harness.run_steps(3);
assert_eq!(balance(&harness, effect), 0.333);
// Typing the value it already has is no edit either
type_balance(&mut harness, &[egui::Key::End, egui::Key::Backspace, egui::Key::Backspace, egui::Key::Backspace, egui::Key::Backspace], "0.333");
harness.key_press(egui::Key::Enter);
harness.run_steps(3);
assert_eq!(harness.state().session.history_labels().len(), steps);
}
+128
View File
@@ -0,0 +1,128 @@
//! The generator panel: global adjustments, restore defaults and image inputs edit the selected generator.
use egui::Role;
use egui_kittest::Harness;
use egui_kittest::kittest::Queryable;
use serde_json::json;
use texturecraft_engine::core::{BakedMap, EffectKind, Generator, GeneratorKind, LayerId, Source};
use texturecraft_engine::{ViewMode, execute};
use texturecraft_ui_egui::TextureCraftApp;
use texturecraft_ui_egui::docking::Panel;
use texturecraft_ui_egui::theme::Brightness;
/// The sample session with a fill layer whose black mask holds a curvature generator, selected in the properties panel.
fn harness(render: bool) -> (Harness<'static, TextureCraftApp>, LayerId) {
let mut session = texturecraft_engine::sample_session(512, 256).unwrap();
session.active_set = 1;
session.camera.pitch = 0.5;
let layer = execute(&mut session, "layer.add.fill", &json!({"color": [0.8, 0.3, 0.1]})).unwrap()["layer"].as_u64().unwrap();
execute(&mut session, "mask.add.black", &json!({})).unwrap();
let effect = execute(&mut session, "effect.add.generator", &json!({"generator": "curvature"})).unwrap()["effect"].as_u64().unwrap();
session.view = ViewMode::Mask(LayerId(layer));
session.update();
let builder = Harness::builder().with_size(egui::vec2(1600.0, 2400.0));
let builder = if render { builder.wgpu() } else { builder };
let mut harness = builder.build_eframe(|context| TextureCraftApp::new(context, session));
harness.state_mut().ui.dock.close(Panel::Layers);
harness.state_mut().ui.dock.close(Panel::TextureSetSettings);
harness.state_mut().ui.dock.focus(Panel::Properties);
harness.run_steps(6);
(harness, LayerId(effect))
}
fn generator(harness: &Harness<'_, TextureCraftApp>, effect: LayerId) -> Generator {
match &harness.state().session.doc.project.effect(effect).unwrap().1.kind {
EffectKind::Generator(generator) => generator.clone(),
_ => panic!("expected a generator"),
}
}
/// Drags the track under slider `label` to the right.
fn drag_slider(harness: &mut Harness<'_, TextureCraftApp>, label: &str) {
harness.get_by_label(label).scroll_to_me();
harness.run_steps(3);
let rect = harness.get_by_label(label).rect();
let start = egui::pos2(rect.left() + 20.0, rect.bottom() + 10.0);
let end = start + egui::vec2(120.0, 0.0);
harness.drag_at(start);
harness.run_steps(2);
harness.hover_at(end);
harness.run_steps(2);
harness.drop_at(end);
harness.run_steps(3);
}
#[test]
fn global_blur_applies_as_one_undo_step() {
let (mut harness, effect) = harness(false);
let history = harness.state().session.history_labels().len();
drag_slider(&mut harness, "Global blur");
assert!(generator(&harness, effect).global.blur > 0.0);
assert_eq!(harness.state().session.history_labels().len(), history + 1);
harness.state_mut().session.undo().unwrap();
assert_eq!(generator(&harness, effect).global.blur, 0.0);
}
#[test]
fn restore_defaults_puts_the_generator_back_to_its_kind_defaults() {
let (mut harness, effect) = harness(false);
let edits = json!({"effect": effect.0, "level": 0.9, "blur": 0.5, "balance": 0.2, "resolutionFactor": -2, "seed": 99});
execute(&mut harness.state_mut().session, "effect.set", &edits).unwrap();
harness.run_steps(3);
harness.get_by_label("Restore defaults").scroll_to_me();
harness.run_steps(2);
harness.get_by_label("Restore defaults").click();
harness.run_steps(3);
assert_eq!(generator(&harness, effect), Generator::new(GeneratorKind::Curvature));
}
#[test]
fn an_input_can_read_a_uniform_value_and_the_mesh_map_again() {
let (mut harness, effect) = harness(false);
harness.get_all_by_role(Role::ComboBox).find(|node| node.value().as_deref() == Some("Mesh map: Curvature")).unwrap().scroll_to_me();
harness.run_steps(3);
harness.get_all_by_role(Role::ComboBox).find(|node| node.value().as_deref() == Some("Mesh map: Curvature")).unwrap().click();
harness.run_steps(2);
harness.get_by_label("Uniform value").click();
harness.run_steps(3);
assert!(matches!(generator(&harness, effect).inputs.get(&BakedMap::Curvature), Some(Source::Uniform(_))));
harness.get_all_by_role(Role::ComboBox).find(|node| node.value().as_deref() == Some("Uniform value")).unwrap().click();
harness.run_steps(2);
harness.get_by_label("Mesh map").click();
harness.run_steps(3);
assert!(generator(&harness, effect).inputs.is_empty());
}
#[test]
#[ignore = "requires a GPU adapter and TC_UI_SNAPSHOTS"]
fn generator_panel_snapshots() {
let directory = std::path::PathBuf::from(std::env::var_os("TC_UI_SNAPSHOTS").expect("set TC_UI_SNAPSHOTS"));
std::fs::create_dir_all(&directory).unwrap();
let (mut harness, effect) = harness(true);
harness.run_steps(12);
harness.render().unwrap().save(directory.join("generator-panel-default.png")).unwrap();
for section in ["Attributes", "Resolution"] {
harness.get_by_label(section).click();
harness.run_steps(3);
}
harness.run_steps(6);
for (brightness, name) in [(Brightness::MediumDark, "medium"), (Brightness::Dark, "dark"), (Brightness::Light, "light")] {
harness.state_mut().ui.prefs.brightness = brightness;
harness.run_steps(3);
harness.render().unwrap().save(directory.join(format!("generator-panel-sections-open-{name}.png"))).unwrap();
}
harness.state_mut().ui.prefs.brightness = Brightness::MediumDark;
let edits = json!({"effect": effect.0, "blur": 0.3, "balance": 0.6, "contrast": 0.4, "resolutionFactor": -2});
execute(&mut harness.state_mut().session, "effect.set", &edits).unwrap();
harness.state_mut().session.update();
harness.run_steps(12);
harness.render().unwrap().save(directory.join("generator-panel-adjusted.png")).unwrap();
// The effect row with its blend mode and opacity, in the layer stack
harness.state_mut().ui.dock.focus(Panel::Layers);
harness.run_steps(12);
harness.render().unwrap().save(directory.join("generator-effect-row.png")).unwrap();
}
+3 -3
View File
@@ -58,9 +58,9 @@ fn mask_and_content_thumbnails_select_their_own_target() {
let at = thumb(&h, "Masked fill", false);
click(&mut h, at);
assert_eq!(h.state().session.target, StackTarget::Content, "the content thumbnail routes back");
// Clicking an effect row still selects that effect.
let r = h.get_by_label("Effect A").rect();
click(&mut h, egui::pos2(r.right() - 40.0, r.center().y));
// Clicking an effect row's name still selects that effect (its right end holds the blend mode and opacity)
let row = h.get_by_label("Effect A").rect();
click(&mut h, row.center());
assert!(matches!(h.state().session.target, StackTarget::Effect(_)));
}
+1
View File
@@ -14,6 +14,7 @@ mod file_dialogs;
mod fill_channel_image;
mod fill_projection_section;
mod filter_picker;
mod generator_panel;
mod history_panel;
mod layer_clipboard;
mod layer_rename;