summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJovansonlee Cesar <ivanceras@gmail.com>2018-07-30 01:58:08 +0800
committerJovansonlee Cesar <ivanceras@gmail.com>2018-07-30 01:58:08 +0800
commit9b6d7b581dc4731d4c26da30c3aab01037892564 (patch)
tree5bb864ce22660a4d11eea00921ca928999f18c68
parentb80eb726abcfd5b8c76df85d88f95e584d949f86 (diff)
enhancing the transistor diode circuit tryw
-rw-r--r--svgbob/src/enhance.rs37
1 files changed, 35 insertions, 2 deletions
diff --git a/svgbob/src/enhance.rs b/svgbob/src/enhance.rs
index 75c5e1b..3bf0474 100644
--- a/svgbob/src/enhance.rs
+++ b/svgbob/src/enhance.rs
@@ -144,6 +144,41 @@ impl<'g> Enhance for FocusChar<'g> {
}
}
}
+ // transistor complimentary enhancement
+ else if self.is('|') {
+ // | |
+ // < >
+ if self.bottom().any("><") {
+ elm.push(line(c, &bottom().m()));
+ }
+ // < >
+ // | |
+ if self.top().any("><") {
+ elm.push(line(w, &top().m()));
+ }
+ } else if self.is('/') {
+ // >
+ // /
+ if self.top_right().is('>') {
+ elm.push(line(u, &top_right().m()));
+ }
+ // /
+ // <
+ if self.bottom_left().is('<') {
+ elm.push(line(e, &bottom_left().m()));
+ }
+ } else if self.is('\\') {
+ // \
+ // >
+ if self.bottom_right().is('>') {
+ elm.push(line(a, &bottom_right().m()));
+ }
+ // <
+ // \
+ if self.top_left().is('<') {
+ elm.push(line(y, &top_left().m()));
+ }
+ }
// circuitries jump
// |
// -(-
@@ -173,11 +208,9 @@ impl<'g> Enhance for FocusChar<'g> {
else if self.is('-') {
if self.right().is(' ') && self.in_right(2).is('-'){
elm.push(dashed_line(k, &right().right().o()));
- //consumed.push(right().right());
}
if self.left().is(' ') && self.in_left(2).is('-'){
elm.push(dashed_line(o, &left().left().k()));
- //consumed.push(left().left());
}
}