d84914ef1e5a
uv_paint_point.rs
//! A finished stroke's endpoint in one mesh's UV layout
use texturecraft_engine::{Session, geom::glam::Vec2};
pub use crate::surface_paint_point::SurfacePaintPoint;
/// A line anchor scoped to its project, UV layout and texture set
#[derive(Clone, Copy, Debug)]
pub struct UvPaintPoint {
mesh_id: u64,
texture_set: usize,
uv: Vec2,
}
impl UvPaintPoint {
pub(crate) fn new(session: &Session, uv: Vec2) -> Self {
Self { mesh_id: session.mesh_id, texture_set: session.ts(), uv }
}
pub(crate) fn uv_for(self, session: &Session) -> Option<Vec2> {
(self.mesh_id == session.mesh_id && self.texture_set == session.ts()).then_some(self.uv)
}
}
No file is open. Choose one in the tree, or press Ctrl+O (⌘O on a Mac) to find one by name.
Syntax highlighting could not load. The unmodified read-only text remains available above.