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

Unpredictable border capture #2000

Closed
showmethecode9527 opened this issue Sep 11, 2019 · 1 comment
Closed

Unpredictable border capture #2000

showmethecode9527 opened this issue Sep 11, 2019 · 1 comment

Comments

@showmethecode9527
Copy link

Bug reports:

the border capture is unpredicatable, jsfiddle.

<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
  <meta charset="UTF-8">
  <title>html2canvas</title>
  <link rel="stylesheet" href="./index.css">
  <style>
    .test {
      padding: 5px 1.6mm;
    }

    .test-row{
        border: #000 1px solid;
        font-size: 0;
        line-height: 0;
        width: 32mm;
    }
    .test-row span{
        display: inline-block;
        border-right: #000 0.5px solid;
        width: 8mm;
        height: 8mm;
        position: relative;
    }
    .test-row span.end{
        display: block;
        width: auto;
        height: 2mm;
        border-top: #000 0.5px solid;
        border-bottom: #000 0.5px solid;
        border-right: 0;
        font-size: 12px;
        text-align: right;
        color: #666;
    }
    .test-row span.end:last-child{
        display: none;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="test">
      <div class="test-row">
        <span></span>
        <span class="end"></span>
        <span></span>
        <span class="end"></span>
      </div>
    </div>
  </div>
  <button onclick="capture()">Capture</button>
  
  <script src="https://github.com/niklasvh/html2canvas/releases/download/v1.0.0-rc.3/html2canvas.min.js"></script>
  <script>
  function capture () {
    console.log('capture')
    html2canvas(document.querySelector('.container')).then(canvas => {
      document.body.appendChild(canvas)
    })
  }
  </script>
</body>
</html>

Specifications:

  • html2canvas version tested with: v1.0.0-rc.3
  • Browser & version: Chrome 76.0.3809.132
  • Operating system: Windows 7 x64
@niklasvh
Copy link
Owner

Should be fixed with #2010

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

No branches or pull requests

2 participants