mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Release 0.18.1 of egui & epaint - Change Shape::Callback to &mut dyn Any (#1552)
This commit is contained in:
@@ -7,6 +7,10 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui-w
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
|
||||||
|
## 0.18.1 - 2022-05-01
|
||||||
|
* Change `Shape::Callback` from `&dyn Any` to `&mut dyn Any` to support more backends.
|
||||||
|
|
||||||
|
|
||||||
## 0.18.0 - 2022-04-30
|
## 0.18.0 - 2022-04-30
|
||||||
|
|
||||||
### Added ⭐
|
### Added ⭐
|
||||||
|
|||||||
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -1100,7 +1100,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "egui"
|
name = "egui"
|
||||||
version = "0.18.0"
|
version = "0.18.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash 0.7.6",
|
"ahash 0.7.6",
|
||||||
"epaint",
|
"epaint",
|
||||||
@@ -1286,7 +1286,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "epaint"
|
name = "epaint"
|
||||||
version = "0.18.0"
|
version = "0.18.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ab_glyph",
|
"ab_glyph",
|
||||||
"ahash 0.7.6",
|
"ahash 0.7.6",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "egui"
|
name = "egui"
|
||||||
version = "0.18.0"
|
version = "0.18.1"
|
||||||
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
||||||
description = "An easy-to-use immediate mode GUI that runs on both web and native"
|
description = "An easy-to-use immediate mode GUI that runs on both web and native"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
@@ -48,7 +48,7 @@ serde = ["dep:serde", "epaint/serde"]
|
|||||||
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
epaint = { version = "0.18.0", path = "../epaint", default-features = false }
|
epaint = { version = "0.18.1", path = "../epaint", default-features = false }
|
||||||
|
|
||||||
ahash = "0.7"
|
ahash = "0.7"
|
||||||
nohash-hasher = "0.2"
|
nohash-hasher = "0.2"
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ All notable changes to the epaint crate will be documented in this file.
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
|
||||||
|
## 0.18.1 - 2022-05-01
|
||||||
|
* Change `Shape::Callback` from `&dyn Any` to `&mut dyn Any` to support more backends.
|
||||||
|
|
||||||
|
|
||||||
## 0.18.0 - 2022-04-30
|
## 0.18.0 - 2022-04-30
|
||||||
* MSRV (Minimum Supported Rust Version) is now `1.60.0` ([#1467](https://github.com/emilk/egui/pull/1467)).
|
* MSRV (Minimum Supported Rust Version) is now `1.60.0` ([#1467](https://github.com/emilk/egui/pull/1467)).
|
||||||
* Add `Shape::Callback` for backend-specific painting ([#1351](https://github.com/emilk/egui/pull/1351)).
|
* Add `Shape::Callback` for backend-specific painting ([#1351](https://github.com/emilk/egui/pull/1351)).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "epaint"
|
name = "epaint"
|
||||||
version = "0.18.0"
|
version = "0.18.1"
|
||||||
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
|
||||||
description = "Minimal 2D graphics library for GUI work"
|
description = "Minimal 2D graphics library for GUI work"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|||||||
@@ -754,12 +754,12 @@ pub struct PaintCallback {
|
|||||||
///
|
///
|
||||||
/// The rendering backend is also responsible for restoring any state,
|
/// The rendering backend is also responsible for restoring any state,
|
||||||
/// such as the bound shader program and vertex array.
|
/// such as the bound shader program and vertex array.
|
||||||
pub callback: Arc<dyn Fn(&PaintCallbackInfo, &dyn std::any::Any) + Send + Sync>,
|
pub callback: Arc<dyn Fn(&PaintCallbackInfo, &mut dyn std::any::Any) + Send + Sync>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PaintCallback {
|
impl PaintCallback {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn call(&self, info: &PaintCallbackInfo, render_ctx: &dyn std::any::Any) {
|
pub fn call(&self, info: &PaintCallbackInfo, render_ctx: &mut dyn std::any::Any) {
|
||||||
(self.callback)(info, render_ctx);
|
(self.callback)(info, render_ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user