1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Improve docs, especially of epaint, and add epaint/CHANGELOG.md

This commit is contained in:
Emil Ernerfeldt
2021-10-10 15:35:13 +02:00
parent 88d087b462
commit e547b149ca
15 changed files with 160 additions and 90 deletions

View File

@@ -624,10 +624,14 @@ impl Context {
/// Tessellate the given shapes into triangle meshes.
pub fn tessellate(&self, shapes: Vec<ClippedShape>) -> Vec<ClippedMesh> {
// A tempting optimization is to reuse the tessellation from last frame if the
// shapes are the same, but just comparing the shapes takes about 50% of the time
// it takes to tessellate them, so it is not a worth optimization.
let mut tessellation_options = self.memory().options.tessellation_options;
tessellation_options.pixels_per_point = self.pixels_per_point();
tessellation_options.aa_size = 1.0 / self.pixels_per_point();
let paint_stats = PaintStats::from_shapes(&shapes); // TODO: internal allocations
let paint_stats = PaintStats::from_shapes(&shapes);
let clipped_meshes = tessellator::tessellate_shapes(
shapes,
tessellation_options,

View File

@@ -472,8 +472,8 @@ macro_rules! trace {
// ----------------------------------------------------------------------------
/// An assert that is only active when `egui` is compiled with the `egui_assert` feature
/// or with the `debug_egui_assert` feature in debug builds.
/// An assert that is only active when `egui` is compiled with the `extra_asserts` feature
/// or with the `extra_debug_asserts` feature in debug builds.
#[macro_export]
macro_rules! egui_assert {
($($arg: tt)*) => {

View File

@@ -408,7 +408,7 @@ impl Response {
/// Check for more interactions (e.g. sense clicks on a `Response` returned from a label).
///
/// Note that this call will not add any hover-effects to the widget, so when possible
/// it is better to give the widget a `Sense` instead, e.g. using `[Label::sense]`.
/// it is better to give the widget a `Sense` instead, e.g. using [`crate::Label::sense`].
///
/// ```
/// # let mut ui = egui::Ui::__test();

View File

@@ -19,18 +19,22 @@ mod separator;
mod slider;
pub(crate) mod text_edit;
pub use button::*;
pub use drag_value::DragValue;
pub use hyperlink::*;
pub use image::Image;
pub use label::*;
pub use progress_bar::ProgressBar;
pub use selected_label::*;
pub use separator::*;
pub use {button::*, drag_value::DragValue, image::Image, slider::*, text_edit::*};
pub use selected_label::SelectableLabel;
pub use separator::Separator;
pub use slider::*;
pub use text_edit::*;
// ----------------------------------------------------------------------------
/// Anything implementing Widget can be added to a [`Ui`] with [`Ui::add`].
///
/// `[Button]`, `[Label]`, [`Slider`], etc all implement the `Widget` trait.
/// [`Button`], [`Label`], [`Slider`], etc all implement the `Widget` trait.
///
/// Note that the widgets (`Button`, `TextEdit` etc) are
/// [builders](https://doc.rust-lang.org/1.0.0/style/ownership/builders.html),