1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Release 0.18.1 of egui & epaint - Change Shape::Callback to &mut dyn Any (#1552)

This commit is contained in:
Emil Ernerfeldt
2022-05-01 11:35:29 +02:00
committed by GitHub
parent dc26890a80
commit b30224471c
6 changed files with 15 additions and 7 deletions

View File

@@ -5,6 +5,10 @@ All notable changes to the epaint crate will be documented in this file.
## 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
* 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)).

View File

@@ -1,6 +1,6 @@
[package]
name = "epaint"
version = "0.18.0"
version = "0.18.1"
authors = ["Emil Ernerfeldt <emil.ernerfeldt@gmail.com>"]
description = "Minimal 2D graphics library for GUI work"
edition = "2021"

View File

@@ -754,12 +754,12 @@ pub struct PaintCallback {
///
/// The rendering backend is also responsible for restoring any state,
/// 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 {
#[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);
}
}