mirror of https://github.com/Aloxaf/silicon
fix missing -1 for top right corner, add example directory and update picture to readme
I also added example.sh, I think it could also be excluded.
This commit is contained in:
parent
329e58c45a
commit
a111c4aa93
|
@ -9,7 +9,7 @@ Silicon is an alternative to [Carbon](https://github.com/dawnlabs/carbon) implem
|
|||
|
||||
It can render your source code into a beautiful image.
|
||||
|
||||
<img width="66%" src="http://storage.aloxaf.cn/silicon.png?v=2">
|
||||
<img width="66%" src="example/example.png">
|
||||
|
||||
## Why Silicon
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
|
@ -0,0 +1,10 @@
|
|||
fn factorial(n: u64) -> u64 {
|
||||
match n {
|
||||
0 => 1,
|
||||
_ => n * factorial(n - 1),
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("10! = {}", factorial(10));
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
silicon example.rs -o example.png
|
|
@ -303,7 +303,7 @@ pub(crate) fn round_corner(image: &mut DynamicImage, radius: u32) {
|
|||
image.copy_from(&*part, 0, 0).unwrap();
|
||||
|
||||
// top right
|
||||
let part = crop_imm(&circle, radius + 1, 1, radius, radius);
|
||||
let part = crop_imm(&circle, radius + 1, 1, radius, radius - 1);
|
||||
image.copy_from(&*part, width - radius, 0).unwrap();
|
||||
|
||||
// bottom left
|
||||
|
|
Loading…
Reference in New Issue