pub struct Path { /* private fields */ }Implementations§
Source§impl Path
impl Path
Sourcepub fn set_tolerance(&mut self, tolerance: f32) -> f32
pub fn set_tolerance(&mut self, tolerance: f32) -> f32
Set curve flattening tolerance in target pixels and return the old value. Invalid values preserve the setting; 0.2 is the legacy default.
Sourcepub fn begin(&mut self, dc: &Dc)
pub fn begin(&mut self, dc: &Dc)
path_begin: an empty path; ox, oy = the draw origin used by the integer API
pub fn set_origin(&mut self, ox: i32, oy: i32)
pub fn is_empty(&self) -> bool
Sourcepub fn pts_mut(&mut self) -> &mut [(f32, f32)]
pub fn pts_mut(&mut self) -> &mut [(f32, f32)]
the flattened points of every subpath (target pixels), e.g. to shear them before a fill (the asm’s g_pts / g_npts) // paint-tools: Kritzel’s italic text
Sourcepub fn add_pt(&mut self, p: (f32, f32))
pub fn add_pt(&mut self, p: (f32, f32))
path_add_pt: append to the open subpath (a new one starts at the current point if none is open); a duplicate of the previous point is skipped
pub fn move_fx(&mut self, x: i32, y: i32)
pub fn move_f(&mut self, x: f32, y: f32)
pub fn line_fx(&mut self, x: i32, y: i32)
pub fn line_f(&mut self, x: f32, y: f32)
pub fn close(&mut self)
Sourcepub fn quad_fx(&mut self, cx: i32, cy: i32, x: i32, y: i32)
pub fn quad_fx(&mut self, cx: i32, cy: i32, x: i32, y: i32)
path_quad (24.8 fixed, origin-relative)
Sourcepub fn quad_f(&mut self, cx: f32, cy: f32, x: f32, y: f32)
pub fn quad_f(&mut self, cx: f32, cy: f32, x: f32, y: f32)
path_quad_f: quadratic Bezier from the current point (float pixels)
Sourcepub fn cubic_fx(
&mut self,
c1x: i32,
c1y: i32,
c2x: i32,
c2y: i32,
x: i32,
y: i32,
)
pub fn cubic_fx( &mut self, c1x: i32, c1y: i32, c2x: i32, c2y: i32, x: i32, y: i32, )
path_cubic (24.8 fixed, origin-relative)
Sourcepub fn cubic_f(&mut self, p1: (f32, f32), p2: (f32, f32), p3: (f32, f32))
pub fn cubic_f(&mut self, p1: (f32, f32), p2: (f32, f32), p3: (f32, f32))
a cubic Bezier from the current point in float pixels (the flattening of path_cubic)
pub fn rect_fx(&mut self, x: i32, y: i32, w: i32, h: i32)
Sourcepub fn rrect_fx(&mut self, x: i32, y: i32, w: i32, h: i32, r: i32)
pub fn rrect_fx(&mut self, x: i32, y: i32, w: i32, h: i32, r: i32)
path_rrect: closed rounded rectangle, r clamped to min(w, h) / 2
Sourcepub fn ellipse_fx(&mut self, cx: i32, cy: i32, rx: i32, ry: i32)
pub fn ellipse_fx(&mut self, cx: i32, cy: i32, rx: i32, ry: i32)
path_ellipse: closed ellipse from four cubic arcs
Sourcepub fn fill_lines(&self, ras: &mut Raster)
pub fn fill_lines(&self, ras: &mut Raster)
the line list of path_fill: every subpath of 2+ points closed implicitly