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

Re-factor and convert the code in src/core/pattern.js to use standard classes #13377

Merged
merged 3 commits into from
May 14, 2021

Commits on May 14, 2021

  1. Remove unused properties from the Shadings-implementations in `src/…

    …core/pattern.js`
    
    Neither the `type` or the `cs` properties are used outside of the "constructors", and we can thus remove them.[1]
    Note that a lot of this code is very old, and that it actually predates the main/worker-thread split before which the *same* file was used on both the main- *and* worker-threads.
    
    ---
    [1] On the main-thread, a similar `type` property was removed in PR 12591.
    Snuffleupagus committed May 14, 2021
    Configuration menu
    Copy the full SHA
    612b438 View commit details
    Browse the repository at this point in the history
  2. Convert src/core/pattern.js to use standard classes

    Note that this patch only covers `Pattern` and `MeshStreamReader`, since the `Shadings`-implementation required additional re-factoring.
    Snuffleupagus committed May 14, 2021
    Configuration menu
    Copy the full SHA
    6acb2db View commit details
    Browse the repository at this point in the history
  3. Modernize the Shadings structure, in src/core/pattern.js, to use …

    …standard classes
    
    This patch replaces the old structure with a abstract base-class, which the new RadialAxial/Mesh-shading classes then inherit from.[1]
    The old `MeshClosure` can now be removed, since it's not necessary any more, and most of the functions inside of it are now instead methods on the new `MeshShading` class. This is particularly nice, in my opinion, since we previously were *manually* passing around a reference to the current `Mesh`-instance.
    
    ---
    [1] If we want/need to, in the future, split e.g. the Mesh-handling into multiple classes that should now be easy to do.
    Snuffleupagus committed May 14, 2021
    Configuration menu
    Copy the full SHA
    ebe3ee4 View commit details
    Browse the repository at this point in the history