Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
¿Por qué mi navegador representa el doble del valor de altura?

Si se ejecuta debajo del código y DOM, mi navegador se representa el doble de todo el valor de altura.

Primero, probé el siguiente código en aproximadamente: en blanco.

en html:

 ... <canvas id="canvasArea" style=" width: 500px; height: 500px; background-color: E0E0E0; "></canvas> ...

y en js:

 let cv = document.getElementById("canvasArea"); let cvArea = cv.getContent('2d'); cvArea.fillRect(10, 10, 50, 50); // I was thinking this Rect is square cvArea.fillRect(60, 10, 50, 25); // and this Rect is long rectangle

Estaba pensando que el primer rect será dibujar un cuadrado. Pero primero es un rectángulo largo.

¿Por qué pasó esto?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

JS Canvases no tiene en cuenta las dimensiones establecidas por CSS.

Use atributos HTML o configure usando JS.

 let cv = document.getElementById("canvasArea"); let cvArea = cv.getContext('2d'); cvArea.fillRect(10, 10, 50, 50); // I was thinking this Rect is square //cvArea.fillRect(60, 10, 50, 25); // and this Rect is long rectangle
 <canvas id="canvasArea" width="500" height="500" style=" background-color: #E0E0E0; "></canvas>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!