Web: forbid additional functions in favor of caching them (#3219)
This commit is contained in:
parent
21701a33de
commit
eab982c402
5 changed files with 87 additions and 77 deletions
|
|
@ -196,7 +196,7 @@ impl Inner {
|
|||
#[inline]
|
||||
pub fn set_cursor_icon(&self, cursor: CursorIcon) {
|
||||
*self.previous_pointer.borrow_mut() = cursor.name();
|
||||
backend::set_canvas_style_property(self.canvas.borrow().raw(), "cursor", cursor.name());
|
||||
self.canvas.borrow().style().set("cursor", cursor.name());
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
@ -223,13 +223,12 @@ impl Inner {
|
|||
#[inline]
|
||||
pub fn set_cursor_visible(&self, visible: bool) {
|
||||
if !visible {
|
||||
backend::set_canvas_style_property(self.canvas.borrow().raw(), "cursor", "none");
|
||||
self.canvas.borrow().style().set("cursor", "none");
|
||||
} else {
|
||||
backend::set_canvas_style_property(
|
||||
self.canvas.borrow().raw(),
|
||||
"cursor",
|
||||
&self.previous_pointer.borrow(),
|
||||
);
|
||||
self.canvas
|
||||
.borrow()
|
||||
.style()
|
||||
.set("cursor", &self.previous_pointer.borrow());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue