Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add layer transforms, interaction in layer #3906

Merged
merged 39 commits into from
Feb 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
24143f4
add scaling layers, interaction with scaled items
Jan 27, 2024
0f6f82c
fix style
Tweoss Jan 27, 2024
141433d
add pan_zoom demo
Tweoss Jan 29, 2024
c001c5a
add pan_zoom demo
Tweoss Jan 29, 2024
085c593
fix warnings
Tweoss Jan 29, 2024
af79f81
Merge branch 'master' into transform-layer
Tweoss Jan 29, 2024
9fc5b71
Merge branch 'master' into transform-layer
Tweoss Jan 29, 2024
264726b
clean up
Tweoss Jan 29, 2024
17bb75e
port TSTransform to emath, make transform persist
Tweoss Feb 1, 2024
b2342dc
use smooth scrolling in demo
Tweoss Feb 1, 2024
ac2ae96
update docstring in layers.rs
Tweoss Feb 1, 2024
998a6e6
fix cranky, style
Tweoss Feb 1, 2024
b0d73d0
Update crates/egui/src/context.rs doc comment
Tweoss Feb 1, 2024
18347d3
add TSTransform doctests, switch transform order
Tweoss Feb 1, 2024
e593bbf
minor refactoring
Tweoss Feb 1, 2024
227bd6a
add invert method for TSTransform
Tweoss Feb 1, 2024
5902ffd
add back translate for mesh.
Tweoss Feb 1, 2024
635fc2f
Merge branch 'master' into transform-layer
Tweoss Feb 1, 2024
9090324
Update docstring crates/emath/src/ts_transform.rs
Tweoss Feb 10, 2024
6178cd8
simplify pan_zoom logic, multiply TSTransforms
Tweoss Feb 10, 2024
f1df40a
fix TSTransform doc comments
Tweoss Feb 10, 2024
05ba7c8
optimize arcs in transforming galley
Tweoss Feb 10, 2024
be325f0
scale thickness of strokes when transforming
Tweoss Feb 10, 2024
0b892d7
clarify paintcallback scaling comment
Tweoss Feb 10, 2024
2526e5b
fix cranky
Tweoss Feb 10, 2024
5b33246
Merge branch 'master' into transform-layer
Tweoss Feb 10, 2024
f70293a
Merge branch 'master' into transform-layer
Tweoss Feb 15, 2024
663a1b3
fix drag ratio
Tweoss Feb 16, 2024
09c4a50
apply transform to mouse input positions
Tweoss Feb 16, 2024
edafee5
add drag_value example
Tweoss Feb 16, 2024
7fd7e7c
fix formatting
Tweoss Feb 16, 2024
499492e
fix area: use response (not ctx) pointer delta
Tweoss Feb 16, 2024
3c27b3b
refactor hover_pos transform in response.rs
Tweoss Feb 16, 2024
bd46536
add label and link to pan_zoom demo
Tweoss Feb 16, 2024
b0afe90
add tracking inner contents to outer window
Tweoss Feb 16, 2024
c6ca843
fix text inner bounds
Tweoss Feb 17, 2024
f6851ab
add painter example
Tweoss Feb 17, 2024
f4ed104
fix pointer interaction for transforms in SidePanel
Tweoss Feb 17, 2024
b109093
fix topbottom panel pointer position
Tweoss Feb 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix text inner bounds
Tweoss committed Feb 17, 2024
commit c6ca843628c6d0c736acd5e1d85c0d119f2ec57d
4 changes: 4 additions & 0 deletions crates/epaint/src/shape.rs
Original file line number Diff line number Diff line change
@@ -394,10 +394,14 @@ impl Shape {
// Scale text:
let galley = Arc::make_mut(&mut text_shape.galley);
for row in &mut galley.rows {
row.visuals.mesh_bounds = transform.scaling * row.visuals.mesh_bounds;
for v in &mut row.visuals.mesh.vertices {
v.pos = Pos2::new(transform.scaling * v.pos.x, transform.scaling * v.pos.y);
}
}

galley.mesh_bounds = transform.scaling * galley.mesh_bounds;
galley.rect = transform.scaling * galley.rect;
}
Self::Mesh(mesh) => {
mesh.transform(transform);