Skip to content

Non-integer grid size #425

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

Open
S119349 opened this issue Apr 29, 2022 · 1 comment
Open

Non-integer grid size #425

S119349 opened this issue Apr 29, 2022 · 1 comment
Assignees

Comments

@S119349
Copy link

S119349 commented Apr 29, 2022

It is currently not possible to have a grid that is not an integer number of points. E.g., the following declaration in a stylesheet
<gridsize name="1mm" value="2.8346456693" />
is silently ignored. Indeed, in the source, we find int iGridSize. Would it be possible to change this to double to allow for different grids?

@otfried otfried self-assigned this Apr 29, 2022
@otfried
Copy link
Owner

otfried commented Apr 29, 2022

The problem is that Ipe stores coordinates in points, and there have always been problems with rounding errors when Ipe supported fractional grid sizes (in Ipe 6).

If you want mm- correct drawings, I suggest you draw them as if 3 pts equal 1 mm. Then, when you need the image, you scale it (for instance when including in Latex using \includegraphics) by the factor 1.05833333.

At some point I want to allow coordinates in Ipe files to be mm-correct, with the conversion to PDF points happening automatically when saving in PDF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants