mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-03 21:08:18 +00:00
Add the Mask node (#1080)
* Add MaskImageNode Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
parent
ea02a2d53a
commit
9c4164291c
7 changed files with 56 additions and 4 deletions
|
@ -442,7 +442,7 @@ mod image {
|
|||
&mut self.image.data[y * (self.image.width as usize) + x]
|
||||
}
|
||||
|
||||
/// Clamps the provided point to (0, 0) (ImageSize) and returns the closest pixel
|
||||
/// Clamps the provided point to ((0, 0), (ImageSize.x, ImageSize.y)) and returns the closest pixel
|
||||
pub fn sample(&self, position: DVec2) -> Color {
|
||||
let x = position.x.clamp(0., self.image.width as f64 - 1.) as usize;
|
||||
let y = position.y.clamp(0., self.image.height as f64 - 1.) as usize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue