metafizzy / metafizzy/zdog

add compositeChild flag to prevent copying

Open
#70 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.7k
Forks
407
PR merge metrics
No merged PRs in 30d

Description

A to-do for me. The composite shapes have some API weirdness:

+ Currently `Box` uses `BoxRect` class, which like a `Rect` only it isn't copied with `copyGraph`, because a `Box` will add its on `BoxRect` children when created.
+ `Cone` also has a `Anchor` which gets duplicated, it should be a `ConeAnchor` or something.
+ And I'm considering adding an `Anchor` inside `Hemisphere` for keeping track of its apex.

Rather than creating special classes like `BoxRect`, I think a cleaner solution would be to add a flag property like `compositeChild`. So that items with this flag will not get copied with `copyGraph`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Box, BoxRect, Cone, Anchor, Hemisphere, and copyGraph entry points to understand how composite children are created and copied. Done means a supported compositeChild flag prevents flagged items from being copied by copyGraph without requiring special classes such as BoxRect.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.