egui/crates/epaint/src
Francis Chua 069d7a634d
Add layer transforms, interaction in layer (#3906)
⚠️ Removes `Context::translate_layer`, replacing it with a sticky
`set_transform_layer`

Adds the capability to scale layers.
Allows interaction with scaled and transformed widgets inside
transformed layers.

I've also added a demo of how to have zooming and panning in a window
(see the video below).

This probably closes #1811. Having a panning and zooming container would
just be creating a new
`Area` with a new id, and applying zooming and panning with
`ctx.transform_layer`.

I've run the github workflow scripts in my repository, so hopefully the
formatting and `cargo cranky` is satisfied.

I'm not sure if all call sites where transforms would be relevant have
been handled. This might also be missing are transforming clipping
rects, but I'm not sure where / how to accomplish that. In the demo, the
clipping rect is transformed to match, which seems to work.


https://github.com/emilk/egui/assets/70821802/77e7e743-cdfe-402f-86e3-7744b3ee7b0f

---------

Co-authored-by: tweoss <fchua@puffer5.stanford.edu>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2024-02-17 11:02:56 +01:00
..
text Fix text selection crashes 2024-01-24 15:47:44 +01:00
util Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
bezier.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
image.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
lib.rs Parallell tessellation (#3934) 2024-02-01 16:27:59 +01:00
mesh.rs Add layer transforms, interaction in layer (#3906) 2024-02-17 11:02:56 +01:00
mutex.rs Use `impl Into<Stroke>` as argument in a few more places (#3420) 2023-11-10 21:36:51 +01:00
shadow.rs Style tweaks (#2406) 2022-12-08 10:55:13 +01:00
shape.rs Add layer transforms, interaction in layer (#3906) 2024-02-17 11:02:56 +01:00
shape_transform.rs Add opacity factor to `TextShape` (#3916) 2024-01-30 15:55:18 +01:00
stats.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
stroke.rs Use `Self` everywhere (#3787) 2024-01-08 17:41:21 +01:00
tessellator.rs Remove profile scope from `tessellate_shape` 2024-02-02 15:53:01 +01:00
texture_atlas.rs Fix buggy text withviewports on monitors with different scales (#3666) 2023-11-30 15:56:05 +01:00
texture_handle.rs Improved texture loading (#3315) 2023-09-12 10:39:17 +02:00
textures.rs Add `TextureOptions::wrap_mode` (#3954) 2024-02-05 09:37:05 +01:00