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

Allow eye interfaces to have different paths for each eye #104

Closed
wants to merge 7 commits into from

Conversation

mustanggb
Copy link
Contributor

e.g.
Means users are able to do something like this:

final class MyEye implements EyeInterface
{
    <snip>

    public function getExternalPath($location) : Path
    {
        switch ($location) {
            case 'topLeft':
                return (new Path())
                    ->move(-3.5, 3.5)
                    ->line(-3.5, 0)
                    ->ellipticArc(3.5, 3.5, 0, false, true, 0, -3.5)
                    ->line(3.5, -3.5)
                    ->line(3.5, 3.5)
                    ->close()
                    ->move(2.5, 0)
                    ->ellipticArc(2.5, 2.5, 0, false, true, 0, 2.5)
                    ->ellipticArc(2.5, 2.5, 0, false, true, -2.5, 0)
                    ->ellipticArc(2.5, 2.5, 0, false, true, 0, -2.5)
                    ->ellipticArc(2.5, 2.5, 0, false, true, 2.5, 0)
                    ->close()
                ;
            case 'topRight':
                return (new Path())
                    ->move(-3.5, -3.5)
                    ->line(0, -3.5)
                    ->ellipticArc(3.5, 3.5, 0, false, true, 3.5, 0)
                    ->line(3.5, 3.5)
                    ->line(-3.5, 3.5)
                    ->close()
                    ->move(2.5, 0)
                    ->ellipticArc(2.5, 2.5, 0, false, true, 0, 2.5)
                    ->ellipticArc(2.5, 2.5, 0, false, true, -2.5, 0)
                    ->ellipticArc(2.5, 2.5, 0, false, true, 0, -2.5)
                    ->ellipticArc(2.5, 2.5, 0, false, true, 2.5, 0)
                    ->close()
                ;
            case 'bottomLeft':
                return (new Path())
                    ->move(3.5, 3.5)
                    ->line(0, 3.5)
                    ->ellipticArc(3.5, 3.5, 0, false, true, -3.5, 0)
                    ->line(-3.5, -3.5)
                    ->line(3.5, -3.5)
                    ->close()
                    ->move(2.5, 0)
                    ->ellipticArc(2.5, 2.5, 0, false, true, 0, 2.5)
                    ->ellipticArc(2.5, 2.5, 0, false, true, -2.5, 0)
                    ->ellipticArc(2.5, 2.5, 0, false, true, 0, -2.5)
                    ->ellipticArc(2.5, 2.5, 0, false, true, 2.5, 0)
                    ->close()
                ;
        }
    }

    <snip>
}

@mustanggb
Copy link
Contributor Author

Actually on a second look it might just be that eye rotation isn't working.

@codecov-commenter
Copy link

Codecov Report

Merging #104 (70590df) into master (d70c840) will increase coverage by 0.05%.
The diff coverage is 62.50%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #104      +/-   ##
============================================
+ Coverage     63.42%   63.47%   +0.05%     
  Complexity      928      928              
============================================
  Files            47       47              
  Lines          2783     2787       +4     
============================================
+ Hits           1765     1769       +4     
  Misses         1018     1018              
Impacted Files Coverage Δ
src/Renderer/Eye/CompositeEye.php 0.00% <0.00%> (ø)
src/Renderer/Eye/SimpleCircleEye.php 0.00% <0.00%> (ø)
src/Renderer/Eye/ModuleEye.php 100.00% <100.00%> (ø)
src/Renderer/Eye/SquareEye.php 100.00% <100.00%> (ø)
src/Renderer/ImageRenderer.php 94.91% <100.00%> (+0.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d70c840...70590df. Read the comment docs.

@DASPRiD
Copy link
Member

DASPRiD commented Mar 14, 2022

Actually on a second look it might just be that eye rotation isn't working.

Yeah, this does somewhat collide with eye rotation indeed.

@mustanggb
Copy link
Contributor Author

Will close in favour of fixing rotation, see #105.

@mustanggb mustanggb closed this Mar 14, 2022
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.

3 participants