From 9b6d7b581dc4731d4c26da30c3aab01037892564 Mon Sep 17 00:00:00 2001 From: Jovansonlee Cesar Date: Mon, 30 Jul 2018 01:58:08 +0800 Subject: enhancing the transistor diode circuit tryw --- svgbob/src/enhance.rs | 37 +++++++++++++++++++++++++++++++++++-- 1 file 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()); } } -- cgit v1.2.3