mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 02:08:12 +08:00
Bezier-rs: Convert from canvas to svg for constructors (#776)
* Convert constructor to use svg * Convert the through_points functions to svg Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
6e12651c56
commit
aff454ec77
@@ -28,12 +28,12 @@ pub struct ToSVGOptions {
|
||||
|
||||
impl ToSVGOptions {
|
||||
/// Combine and format curve styling options for an SVG path.
|
||||
pub(crate) fn formatted_curve_arguments(&self) -> String {
|
||||
pub fn formatted_curve_arguments(&self) -> String {
|
||||
format!(r#"stroke="{}" stroke-width="{}" fill="none""#, self.curve_stroke_color, self.curve_stroke_width)
|
||||
}
|
||||
|
||||
/// Combine and format anchor styling options an SVG circle.
|
||||
pub(crate) fn formatted_anchor_arguments(&self) -> String {
|
||||
pub fn formatted_anchor_arguments(&self) -> String {
|
||||
format!(
|
||||
r#"r="{}", stroke="{}" stroke-width="{}" fill="{}""#,
|
||||
self.anchor_radius, self.anchor_stroke_color, self.anchor_stroke_width, self.anchor_fill
|
||||
@@ -41,7 +41,7 @@ impl ToSVGOptions {
|
||||
}
|
||||
|
||||
/// Combine and format handle point styling options for an SVG circle.
|
||||
pub(crate) fn formatted_handle_point_arguments(&self) -> String {
|
||||
pub fn formatted_handle_point_arguments(&self) -> String {
|
||||
format!(
|
||||
r#"r="{}", stroke="{}" stroke-width="{}" fill="{}""#,
|
||||
self.handle_point_radius, self.handle_point_stroke_color, self.handle_point_stroke_width, self.handle_point_fill
|
||||
@@ -49,7 +49,7 @@ impl ToSVGOptions {
|
||||
}
|
||||
|
||||
/// Combine and format handle line styling options an SVG path.
|
||||
pub(crate) fn formatted_handle_line_arguments(&self) -> String {
|
||||
pub fn formatted_handle_line_arguments(&self) -> String {
|
||||
format!(r#"stroke="{}" stroke-width="{}" fill="none""#, self.handle_line_stroke_color, self.handle_line_stroke_width)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user