Skip to content

[Question] Additional 1px on rectangle dimensions? #731

@JohnPaulHarold

Description

@JohnPaulHarold

Describe your question

When I create a rect with specific dimensions, I'm finding that when calling getBoundingClientRect() there is an additional 1px added. Is this expected behaviour, and if so, why does it happen?

If this feels like a bug, I can update the ticket, or raise a new one.

Your code (either pasted here, or a link to a hosted example)

https://codepen.io/johnpaulharold/pen/Rwzwrmw

Environment (please select one):

  • Code executes in browser (e.g: using script tag to load library)
  • Packaged software (e.g: ES6 imports, react, angular, vue.js)
  • Running headless (usually Node.js)

If applicable:

Desktop (please complete the following information):

  • OS: OSX (I can test others if needs be)
  • Browser: Chrome/Safari
  • Version: latest stable on both

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions