mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-07 09:28:12 +08:00
Bezier-rs: Update interactive demo site UI/UX (#1085)
* wip - change demo iframe styling * fix typo * change tVariant select from radio buttons to dropdown * Added iframe styling * fix linting errors * Integrated tvariant picker as input options * Updated points in demos * Lint * Clean up CSS --------- Co-authored-by: Thomas Cheng <contact.chengthomas@gmail.com> Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Thomas Cheng
Keavon Chambers
parent
bfbabbc4dc
commit
834cb1a227
@@ -23,8 +23,8 @@ const SCALE_UNIT_VECTOR_FACTOR: f64 = 50.;
|
||||
|
||||
fn parse_t_variant(t_variant: &String, t: f64) -> SubpathTValue {
|
||||
match t_variant.as_str() {
|
||||
"Parametric" => SubpathTValue::GlobalParametric(t),
|
||||
"Euclidean" => SubpathTValue::GlobalEuclidean(t),
|
||||
"GlobalParametric" => SubpathTValue::GlobalParametric(t),
|
||||
"GlobalEuclidean" => SubpathTValue::GlobalEuclidean(t),
|
||||
_ => panic!("Unexpected TValue string: '{}'", t_variant),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use glam::DVec2;
|
||||
|
||||
// SVG drawing constants
|
||||
pub const SVG_OPEN_TAG: &str = r#"<svg xmlns="http://www.w3.org/2000/svg" width="200px" height="200px">"#;
|
||||
pub const SVG_OPEN_TAG: &str = r#"<svg xmlns="http://www.w3.org/2000/svg" width="250px" height="200px">"#;
|
||||
pub const SVG_CLOSE_TAG: &str = "</svg>";
|
||||
|
||||
// Stylistic constants
|
||||
@@ -30,7 +30,7 @@ pub fn wrap_svg_tag(contents: String) -> String {
|
||||
|
||||
/// Helper function to create an SVG text entity.
|
||||
pub fn draw_text(text: String, x_pos: f64, y_pos: f64, fill: &str) -> String {
|
||||
format!(r#"<text x="{x_pos}" y="{y_pos}" fill="{fill}">{text}</text>"#)
|
||||
format!(r#"<text x="{x_pos}" y="{y_pos}" fill="{fill}" font-family="monospace">{text}</text>"#)
|
||||
}
|
||||
|
||||
/// Helper function to create an SVG circle entity.
|
||||
|
||||
Reference in New Issue
Block a user