LivelyKernel / LivelyKernel/lively.graphics
Behavior withTopRight()
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
It seems that withTopRight is the only alteration to redefine a rectangle, that preserves the initial extent, while all others (withTopLeft, withBottomRight ... ) will stretch the rectangle to fit the new corner. Take a look at the following test:
```
it("testWithTopRight", function() {
var result = rect(10,10,10,10).withTopRight(pt(5,5));
expect(pt(5,5)).to.equal(result.topRight());
expect(rect(-5,5,10,10)).to.equal(result);
});
```
What is the reason for this special behavior? I added a 'fix' in 59fb73d but discovered that is apparently not the way it is meant to be.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied test for withTopRight and compare its result with the related withTopLeft and withBottomRight methods. Review commit 59fb73d and the rectangle corner-method implementations to determine the intended extent behavior. Done means the special behavior is explained and the test or implementation reflects the agreed semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100