Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

320
Vistas
JavaScript canvas, drawing to 2d context. Is there really no way to get dimensions of the drawn content afterwards?

Acknowledging the rhetorical nature of this question, maybe better to ask:

Is there a work around to having to pre-analyze the size and location of and every shape and image being drawn to a 2d context to extract the maximum extents of the final drawing?

This seems to be the requirement in order to determine the proper scaling factor for the final context to ensure that nothing is drawn outside the canvas border, if so desired.

For drawings with a multitude of overlapping shapes and images, this seems like excessive computational overhead. As opposed to simply analyzing the resulting 1:1 "window image" once for the used pixel width and height.

Vice-versa, if the drawing is smaller than the canvas and you want to zoom to fill instead.

An zoom-to-extents function built into the canvas would be nice.

Is there a another way to do this?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda