bernhard-42 / vscode-ocp-cad-viewer

A viewer for OCP based Code-CAD (CadQuery, build123d) integrated into VS Code
Apache License 2.0
78 stars 9 forks source link

ImageFace aspect ratio bug #83

Open MatthiasJ1 opened 2 months ago

MatthiasJ1 commented 2 months ago

Casting width/height*scale to int in the ImageFace constructor can break the aspect ratio. This is not very noticeable when using mm but very noticeable when using inches. For example, if I have a 1999x1000 pixel image and I want the height of the image to be 1 inch, I would use a scale of 0.001. Because of the int cast, this would currently result in a skewed image being rendered in a 1x1 inch rectangle, rather than the expected 1.999x1 inch.