egui_commonmark icon indicating copy to clipboard operation
egui_commonmark copied to clipboard

What exactly is the `CommonMarkViewer::id` used for?

Open emilk opened this issue 1 year ago • 1 comments

CommonMarkViewer::new takes a source_id: impl std::hash::Hash as an argument. I have some questions about it:

What exactly is it used for? Is it only used for the scroll cache of show_scrollable? If so, perhaps it could be moved from the constructor to show_scrollable to clarify this.

Should the Id be globally unique, or just unique within the parent Ui? That is: is it used directly, or mixed with ui.id() first?

emilk avatar Jun 25 '24 06:06 emilk

It's there primarily for egui::Grid. I think it was used for something related to images before the image update in egui too if I recall correctly.

lampsitter avatar Jun 25 '24 16:06 lampsitter