Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

or gate close path and draw links before nodes #23

Merged
merged 1 commit into from
Mar 29, 2021

Conversation

dkilfoyle
Copy link
Contributor

Two tiny changes to (microscopically :-) )improve image appearance

  1. Rendering the links before the nodes means that links do not extend slightly into the node
  2. Closing the path of the OR gate results in a nicer shape (top left of the gate)

eg
Before:
Screenshot 2021-03-28 213726

After:
Screenshot 2021-03-28 220221

@@ -189,6 +189,8 @@ export default class HwSchematic {
_applyLayout() {
var root = this.root;

this._applyLayoutLinks();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the move required?
(It is not a problem, I am asking from a curiosity.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. Moving applyLayoutLinks means that the links are drawn before (ie underneath) the nodes. Drawing the node over the top of the link hides the small excursion of the link into the node (the output link in the top picture extends slightly into the node). It's a bit hacky - but probably better than trying to alter the start/end coordinates for each link to match a specific node type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS: my understanding is that D3/SVG has no capability to specifically assign a z-order independent of creation/append order.

@Nic30 Nic30 merged commit fe666e1 into Nic30:master Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants