Skip to content

Commit

Permalink
Merge branch 'master' into 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 18, 2023
2 parents f1db675 + 2b87429 commit 0e1a9e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion native/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iced_native"
version = "0.9.0"
version = "0.9.1"
authors = ["Héctor Ramón Jiménez <[email protected]>"]
edition = "2021"
description = "A renderer-agnostic library for native GUIs"
Expand Down
6 changes: 3 additions & 3 deletions native/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Handle {
pub fn from_pixels(
width: u32,
height: u32,
pixels: impl AsRef<[u8]> + Clone + Send + Sync + 'static,
pixels: impl AsRef<[u8]> + Send + Sync + 'static,
) -> Handle {
Self::from_data(Data::Rgba {
width,
Expand All @@ -44,7 +44,7 @@ impl Handle {
/// This is useful if you already have your image loaded in-memory, maybe
/// because you downloaded or generated it procedurally.
pub fn from_memory(
bytes: impl AsRef<[u8]> + Clone + Send + Sync + 'static,
bytes: impl AsRef<[u8]> + Send + Sync + 'static,
) -> Handle {
Self::from_data(Data::Bytes(Bytes::new(bytes)))
}
Expand Down Expand Up @@ -93,7 +93,7 @@ pub struct Bytes(Arc<dyn AsRef<[u8]> + Send + Sync + 'static>);

impl Bytes {
/// Creates new [`Bytes`] around `data`.
pub fn new(data: impl AsRef<[u8]> + Clone + Send + Sync + 'static) -> Self {
pub fn new(data: impl AsRef<[u8]> + Send + Sync + 'static) -> Self {
Self(Arc::new(data))
}
}
Expand Down
13 changes: 7 additions & 6 deletions native/src/user_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,13 @@ where
overlay.layout(renderer, self.bounds, Vector::ZERO)
});

let new_cursor_position =
if overlay_layout.bounds().contains(cursor_position) {
Point::new(-1.0, -1.0)
} else {
cursor_position
};
let new_cursor_position = if overlay
.is_over(Layout::new(&overlay_layout), cursor_position)
{
Point::new(-1.0, -1.0)
} else {
cursor_position
};

self.overlay = Some(overlay_layout);

Expand Down

0 comments on commit 0e1a9e6

Please sign in to comment.