Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
small white line at the bottom of the screen using p5.js

I am new to p5.js and I am just trying to create a full screen canvas but I am getting a small white line at the bottom of the screen and I can't figure out why

function setup() {
    createCanvas(windowWidth, windowHeight);
    //background(0);
}

function draw() {
    background("#222");
    ellipse(windowWidth / 2, windowHeight / 2, 100, 100);
    fill("#07C");
    noStroke();
}
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>p5.js starter</title>
    <style>
        body {
            /* padding: 0; */
            margin: 0;
            overflow: hidden;
        }
    </style>

    <script src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/p5.min.js"></script>
    <!-- Uncomment below line to enable p5.sound -->
    <!-- <script src="https://cdn.jsdelivr.net/npm/p5@1.4.1/lib/addons/p5.sound.min.js"></script> -->
</head>

<body>
    <script src="sketch.js"></script>
</body>

</html>

This is how it looks like locally

p5.js white line at the bottom

If you open the image in new tab you can notice the issue

Edit : The issue is only happening in chrome it is fine in firefox and brave

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

the first thing you should try doing is adding + 10 to windowHeight or whatever number that is enough to remove this white line, if that doesn't work then it might do with the browser you're using.

about 4 years ago · Juan Pablo Isaza Relatório

0

Changing the styles to

        * {
            padding: 0;
            margin: 0;
        }

        body {
            overflow: hidden;
        }

Fixed the issue

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda