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

No border drawn for a 1x1 rectangle #5331

Closed
jpkoskela opened this issue Oct 23, 2018 · 1 comment · Fixed by #5345
Closed

No border drawn for a 1x1 rectangle #5331

jpkoskela opened this issue Oct 23, 2018 · 1 comment · Fixed by #5345
Labels

Comments

@jpkoskela
Copy link

Version

2.4.2

Test Case

http://jsfiddle.net/jpkoskela/zLh2d6y7/

Information about environment

All browsers.

Steps to reproduce

Add a 1x1 rectangle with 0.1 stroke width to canvas. Zoom in.

Expected Behavior

Border should be rendered for the 1x1 rectangle.

Actual Behavior

Rendering of border is optimized away.

Source of Problem

rect.class.js

 _render: function(ctx) {

      // optimize 1x1 case (used in spray brush)
      if (this.width === 1 && this.height === 1) {
        ctx.fillRect(-0.5, -0.5, 1, 1);
        return;
      }
```
@jpkoskela jpkoskela changed the title No border drawn for a 1x1 rectangle No border drawn for an 1x1 rectangle Oct 23, 2018
@jpkoskela jpkoskela changed the title No border drawn for an 1x1 rectangle No border drawn for a 1x1 rectangle Oct 23, 2018
@asturur
Copy link
Member

asturur commented Oct 26, 2018

you are right. This optimization was for the spray brush. i think since we have caching we should remove it.
Do you want to do it with a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants