Skip to content

v0.23.0

Choose a tag to compare

@github-actions github-actions released this 24 Oct 10:36
· 21 commits to main since this release
4c18bc6

Added

  • Components convert to Node (From<X> and From<&X>): Axes, Callout,
    CodeExplainer, FlowDiagram, LowerThird, ChapterMarker, Matrix,
    Table, TitleCard, EndCard, BulletList go wherever a node does, e.g.
    caption.next_to(&end_card, Side::Bottom).
  • Txt::font_size, Txt::weight and Code::font_size take integers too:
    .font_size(64).
  • .scale(..) on a builder takes one number, a pair or a Vec2:
    .scale(1.5), .scale((2.0, 0.5)), .scale(2).
  • oxframe check: low_contrast reads the pixels behind text that lies
    over a shader, an image, a video, Custom, particles or 3D. The frame is
    drawn without text and the ratio is the median over the text's box; it
    must last 0.5 s to count, so something moving past a label is not
    reported. Text over plain fills is judged as before.
  • A custom WGSL shade (Shader::source, Shader::file) is painted, not
    only checked: an interpreter over naga's IR runs it on the CPU, a tile of
    pixels at a time, with the same bytes on every OS (about 0.13 s for a
    1080p frame in a release build). Textures, samplers and derivatives are
    a shader_error. The playground does not paint it.
  • Inputs of a custom shader: .input("photo", Input::file("photo.png"))
    (or Input::image(include_bytes!(..))) is read in WGSL with
    sample_photo(uv). With .input("scene", Input::frame()) the shader
    reads what was drawn before it and is painted over it inside its box,
    e.g. sample_scene(i.screen / ox.resolution). Calling sample_x with no
    input x is a shader_error that says how to add it.
  • Shader::size(width, height), like width and height together.
  • Example magnifier: a lens written in WGSL that reads the frame.
  • .offscreen() on any node: it is drawn only for a shader that reads it
    with Input::node(handle) (sample_<name>(uv), uv across the node's
    box), never on screen, and check skips it.

Changed

  • lens_drops, node.effect(..) and a frame-reading shader work inside a
    group with opacity below 1, a blur, a clip, a blend, a shadow or another
    effect. The group is drawn in parts on its own, then faded or blurred as
    a whole; a shader in it reads what the group drew before it. check no
    longer reports input_cycle.

Fixed

  • check no longer reports covers_text for a custom shader that reads
    the frame (Input::frame()): the text shows through it, as under
    lens_drops. InspectNode has a reads_frame field.
  • A vector's label (axes.vector(..).label("i")) sits off to the side of
    the tip, so a vector along an axis no longer puts its label on the axis
    line.

Breaking

  • Signal::set takes impl Into<T>, like Signal::to, so
    text.set("Done") and fill.set(Accent) work. A value converted with a
    bare .into() no longer infers its type: drop the .into().
    Before: m.cell(0, 1).text().set("7".into()); → after:
    m.cell(0, 1).text().set("7");
  • Node::scale() returns ScaleSignal, a Signal<Vec2> (it derefs to one)
    whose to and set also take one number for both axes:
    node.scale().to(1.2, 0.3). Code that names the type changes.
    Before: let s: Signal<Vec2> = node.scale(); → after:
    let s: Signal<Vec2> = node.scale().signal(); (or .into()).
  • lint::Sample has a contrast field (measured contrast per text node).
    Before: Sample { time, nodes } → after:
    Sample { time, nodes, contrast: Vec::new() }.
  • Input is no longer Copy (it can hold an image); Input::name takes
    &self. Clone it where it was copied.
  • InspectNode has a reads_frame field; add reads_frame: false where
    you build one.