-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it so FloatFuncs is only used on no_std
- Loading branch information
Showing
18 changed files
with
65 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
//! Example of circle | ||
#[cfg(feature = "std")] | ||
fn main() { | ||
#[cfg(feature = "std")] | ||
{ | ||
use kurbo::{Circle, Shape}; | ||
use kurbo::{Circle, Shape}; | ||
|
||
let circle = Circle::new((400.0, 400.0), 380.0); | ||
println!("<!DOCTYPE html>"); | ||
println!("<html>"); | ||
println!("<body>"); | ||
println!("<svg height=\"800\" width=\"800\">"); | ||
let path = circle.to_path(1e-3).to_svg(); | ||
println!(" <path d=\"{}\" stroke=\"black\" fill=\"none\" />", path); | ||
let path = circle.to_path(1.0).to_svg(); | ||
println!(" <path d=\"{}\" stroke=\"red\" fill=\"none\" />", path); | ||
println!("</svg>"); | ||
println!("</body>"); | ||
println!("</html>"); | ||
} | ||
let circle = Circle::new((400.0, 400.0), 380.0); | ||
println!("<!DOCTYPE html>"); | ||
println!("<html>"); | ||
println!("<body>"); | ||
println!("<svg height=\"800\" width=\"800\">"); | ||
let path = circle.to_path(1e-3).to_svg(); | ||
println!(" <path d=\"{}\" stroke=\"black\" fill=\"none\" />", path); | ||
let path = circle.to_path(1.0).to_svg(); | ||
println!(" <path d=\"{}\" stroke=\"red\" fill=\"none\" />", path); | ||
println!("</svg>"); | ||
println!("</body>"); | ||
println!("</html>"); | ||
} | ||
|
||
#[cfg(not(feature = "std"))] | ||
fn main() { | ||
println!("This example requires the standard library"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
//! Example of ellipse | ||
use kurbo::{Ellipse, Shape}; | ||
use std::f64::consts::PI; | ||
#[cfg(feature = "std")] | ||
fn main() { | ||
use kurbo::{Ellipse, Shape}; | ||
use std::f64::consts::PI; | ||
|
||
let ellipse = Ellipse::new((400.0, 400.0), (200.0, 100.0), 0.25 * PI); | ||
println!("<!DOCTYPE html>"); | ||
println!("<html>"); | ||
println!("<body>"); | ||
println!("<svg height=\"800\" width=\"800\" style=\"background-color: #999\">"); | ||
let path = ellipse.to_path(1e-3).to_svg(); | ||
println!(" <path d=\"{}\" stroke=\"black\" fill=\"none\" />", path); | ||
let path = ellipse.to_path(1.0).to_svg(); | ||
println!(" <path d=\"{}\" stroke=\"red\" fill=\"none\" />", path); | ||
println!("</svg>"); | ||
println!("</body>"); | ||
println!("</html>"); | ||
} | ||
|
||
#[cfg(not(feature = "std"))] | ||
fn main() { | ||
#[cfg(feature = "std")] | ||
{ | ||
let ellipse = Ellipse::new((400.0, 400.0), (200.0, 100.0), 0.25 * PI); | ||
println!("<!DOCTYPE html>"); | ||
println!("<html>"); | ||
println!("<body>"); | ||
println!("<svg height=\"800\" width=\"800\" style=\"background-color: #999\">"); | ||
let path = ellipse.to_path(1e-3).to_svg(); | ||
println!(" <path d=\"{}\" stroke=\"black\" fill=\"none\" />", path); | ||
let path = ellipse.to_path(1.0).to_svg(); | ||
println!(" <path d=\"{}\" stroke=\"red\" fill=\"none\" />", path); | ||
println!("</svg>"); | ||
println!("</body>"); | ||
println!("</html>"); | ||
} | ||
println!("This example requires the standard library"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters