Pull requests

#14 Open
Repository
kevglass kevglass
Branch
development

fix Shape.contains not using working

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update development
hg pull -r golvok/fix-shapecontains-not-working-1372039819667 https://bitbucket.org/golvok/slick
hg merge golvok/fix-shapecontains-not-working-1372039819667
hg commit -m 'Merged in golvok/slick/golvok/fix-shapecontains-not-working-1372039819667 (pull request #14)'
Author
  1. Matthew Walker avatarMatthew Walker
Reviewers
Description

fix Shape.contains not using intersects properly

Comments (4)

  1. nguillaumin

    The javadoc says "Check if the shape passed is entirely contained within this shape", so wouldn't the current logic be correct, since if 2 shapes intersect one can't be entirely contained within the other?

  2. nguillaumin

    Actually I think this test should be removed, because there are actually 2 cases:

    • Shape are only partially intersecting: contains() should return false
    • One shape is completely intersected (contained) within the other: contains() should return true

    But intersects() doesn't distinguish between partial or complete intersection, so it can't be use to take an early exit.

    Thoughts?

  3. Matthew Walker author

    I think that was what I realized at the time.

    I also think I thought it was a typo, and that I assumed that it was meant to be an early out because it is a faster (maybe?) condition to check.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.