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

Allow read access to shapes added to painter this frame #3866

Merged
merged 5 commits into from
Jan 24, 2024

Conversation

brunizzl
Copy link
Contributor

Hello,

I'm interested in exporting a picture drawn by egui as a vector graphic and thus need access to the picture's shapes.

Notes on the submitted code:

Ideally i would want to return the result iterator of PaintList::all_entries to the user. This however failed because of the required lifetimes.

I was unsure wether to use Context::graphics_mut instead of creating Context::graphics and GraphicLayers::existing_list. Given that Context has a mutable and immutable version of these "getters" for other data, i feel it is more consistent to do it this way.

crates/egui/src/layers.rs Outdated Show resolved Hide resolved
crates/egui/src/painter.rs Outdated Show resolved Hide resolved
crates/egui/src/layers.rs Outdated Show resolved Hide resolved
@emilk
Copy link
Owner

emilk commented Jan 23, 2024

Thanks for the PR! I have a few ideas for improvements

brunizzl and others added 4 commits January 23, 2024 14:45
suggested by emilk

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
…o ::get, PaintList::all_entries returns Iterator<&ClippedShape>
@brunizzl
Copy link
Contributor Author

All improvements requested so far are applied.

@emilk emilk added the egui label Jan 24, 2024
@emilk emilk merged commit bcf032a into emilk:master Jan 24, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants