Struct dotrix_egui::Painter[][src]

pub struct Painter { /* fields omitted */ }
Expand description

Helper to paint shapes and text to a specific region on a specific layer.

All coordinates are screen coordinates in the unit points (one point can consist of many physical pixels).

Implementations

redirect

Create a painter for a sub-region of this Painter.

The clip-rect of the returned Painter will be the intersection of the given rectangle and the clip_rect() of this Painter.

Get a reference to the parent CtxRef.

Available fonts.

Where we paint

Everything painted in this Painter will be clipped against this. This means nothing outside of this rectangle will be visible on screen.

Everything painted in this Painter will be clipped against this. This means nothing outside of this rectangle will be visible on screen.

Useful for pixel-perfect rendering.

Useful for pixel-perfect rendering.

Useful for pixel-perfect rendering.

It is up to the caller to make sure there is room for this. Can be used for free painting. NOTE: all coordinates are screen coordinates!

Add many shapes at once.

Calling this once is generally faster than calling Self::add multiple times.

Modify an existing Shape.

text with a background

Show an arrow starting at origin and going in the direction of vec, with the length vec.length().

Lay out and paint some text.

To center the text at the given position, use anchor: (Center, Center).

To find out the size of text before painting it, use Self::layout_no_wrap or Self::layout_multiline.

Returns where the text ended up.

Will line break at \n.

Paint the results with Self::galley. Always returns at least one row.

Will wrap text at the given width and line break at \n.

Paint the results with Self::galley. Always returns at least one row.

Paint text that has already been layed out in a Galley.

You can create the Galley with Self::layout_no_wrap or Self::layout_multiline.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Constructs wrapped service

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.