pub struct PathBuilder {
subpaths: Vec<SubPath>,
current: Option<SubPath>,
last_user: Option<(f32, f32)>,
}Expand description
パス構築器。曲線は折れ線へ分割して保持する。
ラスタライザは「折れ線の集まり」だけを相手にすればよくなるので、 曲線の分割規則をここへ閉じ込めて試験できる。
Fields§
§subpaths: Vec<SubPath>§current: Option<SubPath>§last_user: Option<(f32, f32)>直近の点(変換前のユーザー座標)。曲線の始点に使う。
Implementations§
Source§impl PathBuilder
impl PathBuilder
pub fn new() -> Self
pub fn begin_path(&mut self)
pub fn move_to(&mut self, m: &Matrix, x: f32, y: f32)
pub fn line_to(&mut self, m: &Matrix, x: f32, y: f32)
pub fn close_path(&mut self)
Sourcepub fn bezier_curve_to(
&mut self,
m: &Matrix,
c1x: f32,
c1y: f32,
c2x: f32,
c2y: f32,
x: f32,
y: f32,
)
pub fn bezier_curve_to( &mut self, m: &Matrix, c1x: f32, c1y: f32, c2x: f32, c2y: f32, x: f32, y: f32, )
3 次ベジェ。始点は直近の点。
Sourcepub fn quadratic_curve_to(
&mut self,
m: &Matrix,
cx: f32,
cy: f32,
x: f32,
y: f32,
)
pub fn quadratic_curve_to( &mut self, m: &Matrix, cx: f32, cy: f32, x: f32, y: f32, )
2 次ベジェ。3 次へ昇格させて処理する。
Trait Implementations§
Source§impl Clone for PathBuilder
impl Clone for PathBuilder
Source§fn clone(&self) -> PathBuilder
fn clone(&self) -> PathBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PathBuilder
impl Debug for PathBuilder
Source§impl Default for PathBuilder
impl Default for PathBuilder
Source§fn default() -> PathBuilder
fn default() -> PathBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PathBuilder
impl RefUnwindSafe for PathBuilder
impl Send for PathBuilder
impl Sync for PathBuilder
impl Unpin for PathBuilder
impl UnsafeUnpin for PathBuilder
impl UnwindSafe for PathBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more