Remove lock from element states

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra
2021-08-27 18:04:21 +02:00
co-authored by Nathan Sobo
parent d5b7e2d4e3
commit 53dc08dfc5
14 changed files with 143 additions and 104 deletions
+15
View File
@@ -11,6 +11,7 @@ use pathfinder_geometry::vector::{vec2f, Vector2F};
use serde_json::json;
use std::{
collections::{HashMap, HashSet},
ops::{Deref, DerefMut},
sync::Arc,
};
@@ -269,6 +270,20 @@ impl<'a> EventContext<'a> {
}
}
impl<'a> Deref for EventContext<'a> {
type Target = MutableAppContext;
fn deref(&self) -> &Self::Target {
self.app
}
}
impl<'a> DerefMut for EventContext<'a> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.app
}
}
pub struct DebugContext<'a> {
rendered_views: &'a HashMap<usize, ElementBox>,
pub font_cache: &'a FontCache,